From: Dekel Peled Date: Thu, 15 Oct 2020 15:51:47 +0000 (+0300) Subject: app/testpmd: support VLAN attributes X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=05292bf9317d221be3e7c13ab29a61f3806e9488;p=dpdk.git app/testpmd: support VLAN attributes rte_flow update introduced has_vlan field for ETH header item, and field has_more_vlan for VLAN header item. The new fields are used to clearly indicate packet tagging chrasteristics. This patch updates testpmd CLI to support the new fields. Signed-off-by: Dekel Peled Acked-by: Ori Kam Acked-by: Matan Azrad --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 84bba0f29e..00c70a144a 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -141,12 +141,14 @@ enum index { ITEM_ETH_DST, ITEM_ETH_SRC, ITEM_ETH_TYPE, + ITEM_ETH_HAS_VLAN, ITEM_VLAN, ITEM_VLAN_TCI, ITEM_VLAN_PCP, ITEM_VLAN_DEI, ITEM_VLAN_VID, ITEM_VLAN_INNER_TYPE, + ITEM_VLAN_HAS_MORE_VLAN, ITEM_IPV4, ITEM_IPV4_TOS, ITEM_IPV4_FRAGMENT_OFFSET, @@ -936,6 +938,7 @@ static const enum index item_eth[] = { ITEM_ETH_DST, ITEM_ETH_SRC, ITEM_ETH_TYPE, + ITEM_ETH_HAS_VLAN, ITEM_NEXT, ZERO, }; @@ -946,6 +949,7 @@ static const enum index item_vlan[] = { ITEM_VLAN_DEI, ITEM_VLAN_VID, ITEM_VLAN_INNER_TYPE, + ITEM_VLAN_HAS_MORE_VLAN, ITEM_NEXT, ZERO, }; @@ -2217,6 +2221,13 @@ static const struct token token_list[] = { .next = NEXT(item_eth, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_eth, type)), }, + [ITEM_ETH_HAS_VLAN] = { + .name = "has_vlan", + .help = "packet header contains VLAN", + .next = NEXT(item_eth, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_eth, + has_vlan, 1)), + }, [ITEM_VLAN] = { .name = "vlan", .help = "match 802.1Q/ad VLAN tag", @@ -2258,6 +2269,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vlan, inner_type)), }, + [ITEM_VLAN_HAS_MORE_VLAN] = { + .name = "has_more_vlan", + .help = "packet header contains another VLAN", + .next = NEXT(item_vlan, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vlan, + has_more_vlan, 1)), + }, [ITEM_IPV4] = { .name = "ipv4", .help = "match IPv4 header",