From 4bdd265768f95bd82e50440eebb49088c1c482fd Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 14 Oct 2020 19:35:50 +0300 Subject: [PATCH] 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 --- app/test-pmd/cmdline_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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", -- 2.20.1