[v6,4/5] app/testpmd: support IPv6 fragments
diff mbox series

Message ID 054e9683da4383ffcad3187fac098d5638d4690b.1602595426.git.dekelp@nvidia.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • support match on L3 fragmented packets
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dekel Peled Oct. 13, 2020, 1:32 p.m. UTC
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 <dekelp@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch
diff mbox series

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index cfbf57b..d311b85 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -142,6 +142,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,
@@ -891,6 +892,7 @@  struct parse_action_priv {
 	ITEM_IPV6_HOP,
 	ITEM_IPV6_SRC,
 	ITEM_IPV6_DST,
+	ITEM_IPV6_HAS_FRAG_EXT,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2186,6 +2188,13 @@  static int comp_set_raw_index(struct context *, const struct token *,
 		.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",