From patchwork Thu Sep 3 07:39:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shiri Kuzin X-Patchwork-Id: 76355 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C8EEA04D7; Thu, 3 Sep 2020 09:39:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 54D951BEAF; Thu, 3 Sep 2020 09:39:37 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 2094BE07 for ; Thu, 3 Sep 2020 09:39:35 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shirik@nvidia.com) with SMTP; 3 Sep 2020 10:39:32 +0300 Received: from nvidia.com (nps-server-12.mtl.labs.mlnx [10.7.12.72]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0837dWHi031858; Thu, 3 Sep 2020 10:39:32 +0300 From: Shiri Kuzin To: dev@dpdk.org Cc: viacheslavo@nvidia.com, adrien.mazarguil@6wind.com, rasland@nvidia.com Date: Thu, 3 Sep 2020 10:39:28 +0300 Message-Id: <1599118768-13265-1-git-send-email-shirik@nvidia.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Subject: [dpdk-dev] [RFC v2] ethdev: introduce GENEVE header extension item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 header extension options is the mean intended to present the user data. These ones are implemented in TLV (Type-Length-Value) fashion, in order to support these Geneve protocol feature we will introduce the new item “rte_flow_item_geneve_option” The support for new item will be added to testpmd and include values and masks for the fields: - class - type - data length - data itself The usage example: "flow create 0 ingress pattern ipv4 / udp / geneve / geneve_opt class is 102 type is 80 type mask ff data is 10002 data mask is 7fffffff / end actions drop / end " New item will be added to testpmd to support raw encap/decap action. Signed-off-by: Shiri Kuzin --- lib/librte_ethdev/rte_flow.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index da8bfa5..6a56c9d 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -537,6 +537,13 @@ enum rte_flow_item_type { */ RTE_FLOW_ITEM_TYPE_ECPRI, + /** + * Matches a GENEVE Variable Length Option. + * + * See struct rte_flow_item_geneve_option. + */ + RTE_FLOW_ITEM_TYPE_GENEVE_OPTION, + }; /** @@ -1097,6 +1104,24 @@ struct rte_flow_item_geneve { #endif /** + * RTE_FLOW_ITEM_TYPE_GENEVE_OPTION. + * + * Matches a GENEVE Variable Length Option + */ +struct rte_flow_item_geneve_option { + rte_be16_t option_class; + uint8_t option_type; +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN + uint8_t length:5; + uint8_t rsvd0:3; +#else + uint8_t rsvd0:3; + uint8_t length:5; +#endif + uint8_t data[]; +}; + +/** * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05). * * Matches a VXLAN-GPE header.