From: Dekel Peled Date: Wed, 14 Oct 2020 16:35:50 +0000 (+0300) Subject: app/testpmd: support IPv6 fragments X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4bdd265768f95bd82e50440eebb49088c1c482fd;p=dpdk.git app/testpmd: support IPv6 fragments rte_flow update, following RFC [1], introduced has_frag_ext field for IPv6 header item, used to indicate match on fragmented/non-fragmented packets. This patch updates testpmd CLI to support the new field. To match on non-fragmented IPv6 packets, need to use pattern: ... ipv6 has_frag_ext spec 0 has_frag_ext mask 1 ... To match on fragmented IPv6 packets, need to use pattern: ... ipv6 has_frag_ext spec 1 has_frag_ext mask 1 ... To match on any IPv6 packets, the has_frag_ext field should not be specified for match. [1] https://mails.dpdk.org/archives/dev/2020-August/177257.html Signed-off-by: Dekel Peled Acked-by: Ori Kam --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 25e28fd3c8..4043eac6d0 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -161,6 +161,7 @@ enum index { ITEM_IPV6_HOP, ITEM_IPV6_SRC, ITEM_IPV6_DST, + ITEM_IPV6_HAS_FRAG_EXT, ITEM_ICMP, ITEM_ICMP_TYPE, ITEM_ICMP_CODE, @@ -963,6 +964,7 @@ static const enum index item_ipv6[] = { ITEM_IPV6_HOP, ITEM_IPV6_SRC, ITEM_IPV6_DST, + ITEM_IPV6_HAS_FRAG_EXT, ITEM_NEXT, ZERO, }; @@ -2345,6 +2347,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6, hdr.dst_addr)), }, + [ITEM_IPV6_HAS_FRAG_EXT] = { + .name = "has_frag_ext", + .help = "fragment packet attribute", + .next = NEXT(item_ipv6, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_ipv6, + has_frag_ext, 1)), + }, [ITEM_ICMP] = { .name = "icmp", .help = "match ICMP header",