Lines Matching defs:a

3047 	struct table_rule_action *a)
3056 a->fwd.action = RTE_PIPELINE_ACTION_DROP;
3057 a->action_mask |= 1 << RTE_TABLE_ACTION_FWD;
3068 a->fwd.action = RTE_PIPELINE_ACTION_PORT;
3069 a->fwd.id = id;
3070 a->action_mask |= 1 << RTE_TABLE_ACTION_FWD;
3075 a->fwd.action = RTE_PIPELINE_ACTION_PORT_META;
3076 a->action_mask |= 1 << RTE_TABLE_ACTION_FWD;
3087 a->fwd.action = RTE_PIPELINE_ACTION_TABLE;
3088 a->fwd.id = id;
3089 a->action_mask |= 1 << RTE_TABLE_ACTION_FWD;
3099 struct table_rule_action *a)
3113 if (parser_read_uint32(&a->lb.out[i], tokens[i]) != 0)
3116 a->action_mask |= 1 << RTE_TABLE_ACTION_LB;
3122 parse_policer_action(char *token, enum rte_table_action_policer *a)
3125 *a = RTE_TABLE_ACTION_POLICER_COLOR_GREEN;
3130 *a = RTE_TABLE_ACTION_POLICER_COLOR_YELLOW;
3135 *a = RTE_TABLE_ACTION_POLICER_COLOR_RED;
3140 *a = RTE_TABLE_ACTION_POLICER_DROP;
3170 struct table_rule_action *a)
3182 &a->mtr.mtr[0]) == 0))
3189 a->mtr.tc_mask = 1;
3190 a->action_mask |= 1 << RTE_TABLE_ACTION_MTR;
3196 n_tokens - 1, &a->mtr.mtr[1]) == 0) ||
3199 n_tokens - 11, &a->mtr.mtr[2]) == 0) ||
3202 n_tokens - 21, &a->mtr.mtr[3]) == 0))
3205 a->mtr.tc_mask = 0xF;
3206 a->action_mask |= 1 << RTE_TABLE_ACTION_MTR;
3213 struct table_rule_action *a)
3225 a->tm.subport_id = subport_id;
3226 a->tm.pipe_id = pipe_id;
3227 a->action_mask |= 1 << RTE_TABLE_ACTION_TM;
3234 struct table_rule_action *a)
3245 parse_mac_addr(tokens[1], &a->encap.ether.ether.da) ||
3246 parse_mac_addr(tokens[2], &a->encap.ether.ether.sa))
3249 a->encap.type = RTE_TABLE_ACTION_ENCAP_ETHER;
3250 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3259 parse_mac_addr(tokens[1], &a->encap.vlan.ether.da) ||
3260 parse_mac_addr(tokens[2], &a->encap.vlan.ether.sa) ||
3269 a->encap.vlan.vlan.pcp = pcp & 0x7;
3270 a->encap.vlan.vlan.dei = dei & 0x1;
3271 a->encap.vlan.vlan.vid = vid & 0xFFF;
3272 a->encap.type = RTE_TABLE_ACTION_ENCAP_VLAN;
3273 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3283 parse_mac_addr(tokens[1], &a->encap.qinq.ether.da) ||
3284 parse_mac_addr(tokens[2], &a->encap.qinq.ether.sa) ||
3299 a->encap.qinq.svlan.pcp = svlan_pcp & 0x7;
3300 a->encap.qinq.svlan.dei = svlan_dei & 0x1;
3301 a->encap.qinq.svlan.vid = svlan_vid & 0xFFF;
3302 a->encap.qinq.cvlan.pcp = cvlan_pcp & 0x7;
3303 a->encap.qinq.cvlan.dei = cvlan_dei & 0x1;
3304 a->encap.qinq.cvlan.vid = cvlan_vid & 0xFFF;
3305 a->encap.type = RTE_TABLE_ACTION_ENCAP_QINQ;
3306 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3317 &a->encap.qinq_pppoe.ether.da) ||
3319 &a->encap.qinq_pppoe.ether.sa) ||
3332 parser_read_uint16(&a->encap.qinq_pppoe.pppoe.session_id,
3336 a->encap.qinq_pppoe.svlan.pcp = svlan_pcp & 0x7;
3337 a->encap.qinq_pppoe.svlan.dei = svlan_dei & 0x1;
3338 a->encap.qinq_pppoe.svlan.vid = svlan_vid & 0xFFF;
3339 a->encap.qinq_pppoe.cvlan.pcp = cvlan_pcp & 0x7;
3340 a->encap.qinq_pppoe.cvlan.dei = cvlan_dei & 0x1;
3341 a->encap.qinq_pppoe.cvlan.vid = cvlan_vid & 0xFFF;
3342 a->encap.type = RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE;
3343 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3356 a->encap.mpls.unicast = 1;
3358 a->encap.mpls.unicast = 0;
3362 if (parse_mac_addr(tokens[2], &a->encap.mpls.ether.da) ||
3363 parse_mac_addr(tokens[3], &a->encap.mpls.ether.sa) ||
3373 a->encap.mpls.mpls[0].label = label;
3374 a->encap.mpls.mpls[0].tc = tc;
3375 a->encap.mpls.mpls[0].ttl = ttl;
3381 a->encap.mpls.mpls_count = 1;
3382 a->encap.type = RTE_TABLE_ACTION_ENCAP_MPLS;
3383 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3396 a->encap.mpls.mpls[1].label = label;
3397 a->encap.mpls.mpls[1].tc = tc;
3398 a->encap.mpls.mpls[1].ttl = ttl;
3404 a->encap.mpls.mpls_count = 2;
3405 a->encap.type = RTE_TABLE_ACTION_ENCAP_MPLS;
3406 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3419 a->encap.mpls.mpls[2].label = label;
3420 a->encap.mpls.mpls[2].tc = tc;
3421 a->encap.mpls.mpls[2].ttl = ttl;
3427 a->encap.mpls.mpls_count = 3;
3428 a->encap.type = RTE_TABLE_ACTION_ENCAP_MPLS;
3429 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3442 a->encap.mpls.mpls[3].label = label;
3443 a->encap.mpls.mpls[3].tc = tc;
3444 a->encap.mpls.mpls[3].ttl = ttl;
3446 a->encap.mpls.mpls_count = 4;
3447 a->encap.type = RTE_TABLE_ACTION_ENCAP_MPLS;
3448 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3455 parse_mac_addr(tokens[1], &a->encap.pppoe.ether.da) ||
3456 parse_mac_addr(tokens[2], &a->encap.pppoe.ether.sa) ||
3457 parser_read_uint16(&a->encap.pppoe.pppoe.session_id,
3461 a->encap.type = RTE_TABLE_ACTION_ENCAP_PPPOE;
3462 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3477 parse_mac_addr(tokens[1], &a->encap.vxlan.ether.da) ||
3478 parse_mac_addr(tokens[2], &a->encap.vxlan.ether.sa))
3498 a->encap.vxlan.vlan.pcp = pcp;
3499 a->encap.vxlan.vlan.dei = dei;
3500 a->encap.vxlan.vlan.vid = vid;
3521 a->encap.vxlan.ipv4.sa = rte_be_to_cpu_32(sa.s_addr);
3522 a->encap.vxlan.ipv4.da = rte_be_to_cpu_32(da.s_addr);
3523 a->encap.vxlan.ipv4.dscp = dscp;
3524 a->encap.vxlan.ipv4.ttl = ttl;
3543 a->encap.vxlan.ipv6.sa = sa;
3544 a->encap.vxlan.ipv6.da = da;
3545 a->encap.vxlan.ipv6.flow_label = flow_label;
3546 a->encap.vxlan.ipv6.dscp = dscp;
3547 a->encap.vxlan.ipv6.hop_limit = hop_limit;
3558 parser_read_uint16(&a->encap.vxlan.udp.sp, tokens[1]) ||
3559 parser_read_uint16(&a->encap.vxlan.udp.dp, tokens[2]))
3569 parser_read_uint32(&a->encap.vxlan.vxlan.vni, tokens[1]) ||
3570 (a->encap.vxlan.vxlan.vni > 0xFFFFFF))
3577 a->encap.type = RTE_TABLE_ACTION_ENCAP_VXLAN;
3578 a->action_mask |= 1 << RTE_TABLE_ACTION_ENCAP;
3588 struct table_rule_action *a)
3602 a->nat.ip_version = 1;
3603 a->nat.addr.ipv4 = rte_be_to_cpu_32(addr.s_addr);
3604 a->nat.port = port;
3605 a->action_mask |= 1 << RTE_TABLE_ACTION_NAT;
3617 a->nat.ip_version = 0;
3618 a->nat.addr.ipv6 = addr;
3619 a->nat.port = port;
3620 a->action_mask |= 1 << RTE_TABLE_ACTION_NAT;
3630 struct table_rule_action *a)
3637 a->ttl.decrement = 1;
3639 a->ttl.decrement = 0;
3643 a->action_mask |= 1 << RTE_TABLE_ACTION_TTL;
3650 struct table_rule_action *a)
3656 a->stats.n_packets = 0;
3657 a->stats.n_bytes = 0;
3658 a->action_mask |= 1 << RTE_TABLE_ACTION_STATS;
3665 struct table_rule_action *a)
3671 a->time.time = rte_rdtsc();
3672 a->action_mask |= 1 << RTE_TABLE_ACTION_TIME;
3967 struct table_rule_action *a)
3969 struct rte_table_action_sym_crypto_params *p = &a->sym_crypto;
3971 uint8_t *key = a->sym_crypto_key;
4023 a->action_mask |= 1 << RTE_TABLE_ACTION_SYM_CRYPTO;
4031 struct table_rule_action *a)
4037 if (parser_read_uint32(&a->tag.tag, tokens[1]))
4040 a->action_mask |= 1 << RTE_TABLE_ACTION_TAG;
4047 struct table_rule_action *a)
4053 if (parser_read_uint16(&a->decap.n, tokens[1]))
4056 a->action_mask |= 1 << RTE_TABLE_ACTION_DECAP;
4065 struct table_rule_action *a)
4069 memset(a, 0, sizeof(*a));
4081 n = parse_table_action_fwd(tokens, n_tokens, a);
4095 n = parse_table_action_balance(tokens, n_tokens, a);
4109 n = parse_table_action_meter(tokens, n_tokens, a);
4123 n = parse_table_action_tm(tokens, n_tokens, a);
4137 n = parse_table_action_encap(tokens, n_tokens, a);
4151 n = parse_table_action_nat(tokens, n_tokens, a);
4165 n = parse_table_action_ttl(tokens, n_tokens, a);
4179 n = parse_table_action_stats(tokens, n_tokens, a);
4193 n = parse_table_action_time(tokens, n_tokens, a);
4207 n = parse_table_action_sym_crypto(tokens, n_tokens, a);
4220 n = parse_table_action_tag(tokens, n_tokens, a);
4234 n = parse_table_action_decap(tokens, n_tokens, a);
4266 struct table_rule_action a;
4315 &a);
4325 status = pipeline_table_rule_add(pipeline_name, table_id, &m, &a);
4331 if (a.action_mask & 1 << RTE_TABLE_ACTION_SYM_CRYPTO)
4332 parse_free_sym_crypto_param_data(&a.sym_crypto);
4750 struct table_rule_action *a = &rule->action;
4813 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_FWD)) {
4815 switch (a->fwd.action) {
4821 fprintf(f, "port %u ", a->fwd.id);
4830 fprintf(f, "table %u ", a->fwd.id);
4834 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_LB)) {
4836 for (i = 0; i < RTE_DIM(a->lb.out); i++)
4837 fprintf(f, "%u ", a->lb.out[i]);
4840 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_MTR)) {
4843 if (a->mtr.tc_mask & (1 << i)) {
4845 &a->mtr.mtr[i];
4855 a->mtr.mtr[i].meter_profile_id,
4862 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_TM))
4864 a->tm.subport_id,
4865 a->tm.pipe_id);
4867 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_ENCAP)) {
4869 switch (a->encap.type) {
4872 ether_addr_show(f, &a->encap.ether.ether.da);
4874 ether_addr_show(f, &a->encap.ether.ether.sa);
4880 ether_addr_show(f, &a->encap.vlan.ether.da);
4882 ether_addr_show(f, &a->encap.vlan.ether.sa);
4884 a->encap.vlan.vlan.pcp,
4885 a->encap.vlan.vlan.dei,
4886 a->encap.vlan.vlan.vid);
4891 ether_addr_show(f, &a->encap.qinq.ether.da);
4893 ether_addr_show(f, &a->encap.qinq.ether.sa);
4895 a->encap.qinq.svlan.pcp,
4896 a->encap.qinq.svlan.dei,
4897 a->encap.qinq.svlan.vid,
4898 a->encap.qinq.cvlan.pcp,
4899 a->encap.qinq.cvlan.dei,
4900 a->encap.qinq.cvlan.vid);
4904 fprintf(f, "mpls %s ", (a->encap.mpls.unicast) ?
4906 ether_addr_show(f, &a->encap.mpls.ether.da);
4908 ether_addr_show(f, &a->encap.mpls.ether.sa);
4910 for (i = 0; i < a->encap.mpls.mpls_count; i++) {
4912 &a->encap.mpls.mpls[i];
4924 ether_addr_show(f, &a->encap.pppoe.ether.da);
4926 ether_addr_show(f, &a->encap.pppoe.ether.sa);
4927 fprintf(f, " %u ", a->encap.pppoe.pppoe.session_id);
4932 ether_addr_show(f, &a->encap.vxlan.ether.da);
4934 ether_addr_show(f, &a->encap.vxlan.ether.sa);
4937 a->encap.vxlan.vlan.pcp,
4938 a->encap.vxlan.vlan.dei,
4939 a->encap.vxlan.vlan.vid);
4942 ipv4_addr_show(f, a->encap.vxlan.ipv4.sa);
4944 ipv4_addr_show(f, a->encap.vxlan.ipv4.da);
4946 (uint32_t)a->encap.vxlan.ipv4.dscp,
4947 (uint32_t)a->encap.vxlan.ipv4.ttl);
4950 ipv6_addr_show(f, &a->encap.vxlan.ipv6.sa);
4952 ipv6_addr_show(f, &a->encap.vxlan.ipv6.da);
4954 a->encap.vxlan.ipv6.flow_label,
4955 (uint32_t)a->encap.vxlan.ipv6.dscp,
4956 (uint32_t)a->encap.vxlan.ipv6.hop_limit);
4958 a->encap.vxlan.udp.sp,
4959 a->encap.vxlan.udp.dp,
4960 a->encap.vxlan.vxlan.vni);
4969 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_NAT)) {
4970 fprintf(f, "nat %s ", (a->nat.ip_version) ? "ipv4 " : "ipv6 ");
4971 if (a->nat.ip_version)
4972 ipv4_addr_show(f, a->nat.addr.ipv4);
4974 ipv6_addr_show(f, &a->nat.addr.ipv6);
4975 fprintf(f, " %u ", (uint32_t)(a->nat.port));
4978 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_TTL))
4979 fprintf(f, "ttl %s ", (a->ttl.decrement) ? "dec" : "keep");
4981 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_STATS))
4984 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_TIME))
4987 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_SYM_CRYPTO))
4990 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_TAG))
4991 fprintf(f, "tag %u ", a->tag.tag);
4993 if (a->action_mask & (1LLU << RTE_TABLE_ACTION_DECAP))
4994 fprintf(f, "decap %u ", a->decap.n);
5002 struct table_rule_action *a = &table->rule_default->action;
5006 switch (a->fwd.action) {
5012 fprintf(f, "port %u ", a->fwd.id);
5021 fprintf(f, "table %u ", a->fwd.id);