[v2,04/11] app/testpmd: support IPv6 fragments
diff mbox series

Message ID 3dcc6699f6e3e69b6136e90c562346dba756cb75.1601586563.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. 1, 2020, 9:15 p.m. UTC
rte_flow update, following RFC [1], introduced frag_ext_exist 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 frag_ext_exist spec 0 frag_ext_exist mask 1 ...
To match on fragmented IPv6 packets, need to use pattern:
... ipv6 frag_ext_exist spec 1 frag_ext_exist mask 1 ...
To match on any IPv6 packets, the frag_ext_exist 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>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ori Kam Oct. 4, 2020, 1:49 p.m. UTC | #1
Hi

> -----Original Message-----
> From: Dekel Peled <dekelp@nvidia.com>
> Sent: Friday, October 2, 2020 12:15 AM
> Subject: [PATCH v2 04/11] app/testpmd: support IPv6 fragments
> 
> rte_flow update, following RFC [1], introduced frag_ext_exist 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 frag_ext_exist spec 0 frag_ext_exist mask 1 ...
> To match on fragmented IPv6 packets, need to use pattern:
> ... ipv6 frag_ext_exist spec 1 frag_ext_exist mask 1 ...
> To match on any IPv6 packets, the frag_ext_exist field should
> not be specified for match.
> 
> [1]
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dp
> dk.org%2Farchives%2Fdev%2F2020-
> August%2F177257.html&amp;data=02%7C01%7Corika%40nvidia.com%7C52c00
> 2b1122645c54b6308d8664f3da6%7C43083d15727340c1b7db39efd9ccc17a%7C
> 0%7C0%7C637371837807355091&amp;sdata=mTtFnZKwQ8Cs6XBjbikK76W8Vx
> TOHD6ZVwRK%2BMZizvg%3D&amp;reserved=0
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> ---


Acked-by: Ori Kam <orika@nvidia.com>
Thanks,
Ori

Patch
diff mbox series

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a9bf29f..b078095 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -141,6 +141,7 @@  enum index {
 	ITEM_IPV6_HOP,
 	ITEM_IPV6_SRC,
 	ITEM_IPV6_DST,
+	ITEM_IPV6_FRAG_EXT_EXIST,
 	ITEM_ICMP,
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
@@ -890,6 +891,7 @@  struct parse_action_priv {
 	ITEM_IPV6_HOP,
 	ITEM_IPV6_SRC,
 	ITEM_IPV6_DST,
+	ITEM_IPV6_FRAG_EXT_EXIST,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2185,6 +2187,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_FRAG_EXT_EXIST] = {
+		.name = "frag_ext_exist",
+		.help = "fragment packet attribute",
+		.next = NEXT(item_ipv6, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_ipv6,
+					   frag_ext_exist, 1)),
+	},
 	[ITEM_ICMP] = {
 		.name = "icmp",
 		.help = "match ICMP header",