From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 64CE5A09E4;
	Sun, 17 Jan 2021 11:22:10 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 514C9140DBB;
	Sun, 17 Jan 2021 11:22:10 +0100 (CET)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by mails.dpdk.org (Postfix) with ESMTP id 1130C140DBB
 for <dev@dpdk.org>; Sun, 17 Jan 2021 11:22:07 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 shirik@nvidia.com) with SMTP; 17 Jan 2021 12:22:06 +0200
Received: from nvidia.com (c-141-140-1-007.mtl.labs.mlnx [10.141.140.7])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10HALkmI003653;
 Sun, 17 Jan 2021 12:22:06 +0200
From: Shiri Kuzin <shirik@nvidia.com>
To: dev@dpdk.org
Cc: viacheslavo@nvidia.com, adrien.mazarguil@6wind.com, orika@nvidia.com,
 ferruh.yigit@intel.com, thomas@monjalon.net, rasland@nvidia.com,
 andrew.rybchenko@oktetlabs.ru
Date: Sun, 17 Jan 2021 12:21:17 +0200
Message-Id: <20210117102123.19045-4-shirik@nvidia.com>
X-Mailer: git-send-email 2.21.0
In-Reply-To: <20210117102123.19045-1-shirik@nvidia.com>
References: <20210114070743.2377-1-shirik@nvidia.com>
 <20210117102123.19045-1-shirik@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v7 3/9] app/testpmd: add GENEVE header option
 length support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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>

From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

The patch adds the GENEVE rte flow option length support to
command line interpreter. The flow command with GENEVE
option items looks like:

    flow create 0 ingress pattern eth / ipv4 / udp / geneve vni
    is 100 optlen is 2 / end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the all options length in the GENEVE header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4e9b76626f..9940d4fff9 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -223,6 +223,7 @@ enum index {
 	ITEM_GENEVE,
 	ITEM_GENEVE_VNI,
 	ITEM_GENEVE_PROTO,
+	ITEM_GENEVE_OPTLEN,
 	ITEM_VXLAN_GPE,
 	ITEM_VXLAN_GPE_VNI,
 	ITEM_ARP_ETH_IPV4,
@@ -1101,6 +1102,7 @@ static const enum index item_gtp[] = {
 static const enum index item_geneve[] = {
 	ITEM_GENEVE_VNI,
 	ITEM_GENEVE_PROTO,
+	ITEM_GENEVE_OPTLEN,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2807,6 +2809,14 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
 					     protocol)),
 	},
+	[ITEM_GENEVE_OPTLEN] = {
+		.name = "optlen",
+		.help = "GENEVE options length in dwords",
+		.next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_geneve,
+						  ver_opt_len_o_c_rsvd0,
+						  "\x3f\x00")),
+	},
 	[ITEM_VXLAN_GPE] = {
 		.name = "vxlan-gpe",
 		.help = "match VXLAN-GPE header",
-- 
2.21.0