From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 87CCEA04B6;
	Mon, 12 Oct 2020 12:46:20 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 7C0FA1D6E2;
	Mon, 12 Oct 2020 12:44:15 +0200 (CEST)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 867461D6CD
 for <dev@dpdk.org>; Mon, 12 Oct 2020 12:44:08 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 dekelp@nvidia.com) with SMTP; 12 Oct 2020 13:44:04 +0300
Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx
 [10.228.134.250])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09CAhqvt025485;
 Mon, 12 Oct 2020 13:44:04 +0300
From: Dekel Peled <dekelp@nvidia.com>
To: orika@nvidia.com, thomas@monjalon.net, ferruh.yigit@intel.com,
 arybchenko@solarflare.com, konstantin.ananyev@intel.com,
 olivier.matz@6wind.com, wenzhuo.lu@intel.com, beilei.xing@intel.com,
 bernard.iremonger@intel.com, matan@nvidia.com, shahafs@nvidia.com,
 viacheslavo@nvidia.com
Cc: dev@dpdk.org
Date: Mon, 12 Oct 2020 13:43:03 +0300
Message-Id: <72730b2e9cdd8cb6c81d6c354c818eb9620d2a7e.1602494556.git.dekelp@nvidia.com>
X-Mailer: git-send-email 1.7.1
In-Reply-To: <cover.1602494556.git.dekelp@nvidia.com>
References: <cover.1602064141.git.dekelp@nvidia.com>
 <cover.1602494556.git.dekelp@nvidia.com>
Subject: [dpdk-dev] [PATCH v5 04/11] app/testpmd: support IPv6 fragments
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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>
Acked-by: Ori Kam <orika@nvidia.com>
---
 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 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",
-- 
1.8.3.1