From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D3F1A0A02; Thu, 14 Jan 2021 08:08:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D12B6140EF6; Thu, 14 Jan 2021 08:08:27 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id EEBB6140EF5 for ; Thu, 14 Jan 2021 08:08:26 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shirik@nvidia.com) with SMTP; 14 Jan 2021 09:08:23 +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 10E78GjE013095; Thu, 14 Jan 2021 09:08:23 +0200 From: Shiri Kuzin 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: Thu, 14 Jan 2021 09:07:35 +0200 Message-Id: <20210114070743.2377-2-shirik@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210114070743.2377-1-shirik@nvidia.com> References: <20210112140241.15914-1-shirik@nvidia.com> <20210114070743.2377-1-shirik@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 1/9] lib/librte_ethdev: introduce GENEVE header TLV option item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The Geneve tunneling protocol is designed to allow the user to specify some data context on the packet. The GENEVE TLV (Type-Length-Variable) Option is the mean intended to present the user data. In order to support GENEVE TLV Option the new rte_flow item "rte_flow_item_geneve_opt" is added. The new item contains the values and masks for the following fields: -option class -option type -length -data New item will be added to testpmd to support match and raw encap/decap actions. Signed-off-by: Shiri Kuzin Acked-by: Ori Kam --- lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index a06f64c271..2af7d965e1 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -97,6 +97,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(L2TPV3OIP, sizeof(struct rte_flow_item_l2tpv3oip)), MK_FLOW_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)), MK_FLOW_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)), + MK_FLOW_ITEM(GENEVE_OPT, sizeof(struct rte_flow_item_geneve_opt)), }; /** Generate flow_action[] entry. */ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index 0977a78270..11a6494b8e 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -543,6 +543,14 @@ enum rte_flow_item_type { * See struct rte_flow_item_ipv6_frag_ext. */ RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, + + /** + * Matches Geneve Variable Length Option + * + * See struct rte_flow_item_geneve_opt + */ + RTE_FLOW_ITEM_TYPE_GENEVE_OPT, + }; /** @@ -1627,6 +1635,25 @@ static const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask = { }; #endif +/** + * RTE_FLOW_ITEM_TYPE_GENEVE_OPT + * + * Matches a GENEVE Variable Length Option + */ +struct rte_flow_item_geneve_opt { + rte_be16_t option_class; + uint8_t option_type; + uint8_t option_len; + uint32_t *data; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_GENEVE_OPT. */ +#ifndef __cplusplus +static const struct rte_flow_item_geneve_opt +rte_flow_item_geneve_opt_mask = { + .option_type = 0xff, +}; +#endif /** * Matching pattern item definition. * -- 2.21.0