From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id EAFAC568A for ; Tue, 14 May 2019 11:00:36 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id r7so420351wrr.13 for ; Tue, 14 May 2019 02:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gZjO8bVtZ6hcNFCWG9Q/PlPubleo8GBvqXuQ8OwGC4Y=; b=CAiIt0cgTv+TbutBJ1PybaPWlewaUg0XW3jR8RnwLE7c6de61V6nDH8eejiY3YHmMo wK5OBhQtpKOYE7WLtD27v3zAsYv8mFyPJrJCiXOxMkI4dxKX4dF76cflah9R9nIjrkgt v1D9U1atRY0h1b3l4avFPBGRQ/WVbnnYSm3tGogwQzRovwTxJRpfrKdRArl7u9yJSy1P c0WBRbgTg9o370Mn4GMY2yUKUt28UI+r871mkATXahbWpNxbDznu4WFNR71ur1UlJrP1 dG/H2PHSE87abAfTU+AiAc4gqQRvpraziAbRS1UR+RSU/ZI1uYY9LlUrQl4ENV5AIBPM PTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gZjO8bVtZ6hcNFCWG9Q/PlPubleo8GBvqXuQ8OwGC4Y=; b=BOKKBtqZXFCxRLK9sq0g4Da7v/jyQMqZWnDXo/Iq7nCmutQrLz6yt4UqVQMIi6lQIl sFPNhmZFigri6hORHicTma2yMNSyxTGoEetUiaTVnFYQzXVFTjdUfJyRTShHsXuVt4f5 mVfOgBacAmonuRfPiWEfLfzGzaOKsleXPY7gSNGyEiKKMKvm3hG4SOeXXMRR+Ut6iKhn Q7PysQPejqUVfgnJmFTovRmrQigM5roy/+S9M2SqiE0LfXpayuJfxADQ2LuDHnftmosg FbYphmBhhvEZdOLFRJTGIgrn9SSvUWrHrTt3xIhhvp+tnHvU4PAIW7PPyXOcTdQRVNod JQ6w== X-Gm-Message-State: APjAAAUEUQBWoqEVuqjqVm3kvWToj2Eo+WMOBCzyZio2c/oDPoSqp+OV Z7zHdiBKBtVLU4wMJEbpbpuq6Q== X-Google-Smtp-Source: APXvYqyrPu2LIJH3IZRvUH5utk8uD6vpS4i6oGJFVA+tCLt7VriUX/giM2An4aOLq304YKj5rG8Jjg== X-Received: by 2002:adf:e404:: with SMTP id g4mr20214250wrm.161.1557824436700; Tue, 14 May 2019 02:00:36 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f6sm1718302wmh.13.2019.05.14.02.00.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 02:00:35 -0700 (PDT) Date: Tue, 14 May 2019 11:00:34 +0200 From: Adrien Mazarguil To: Andrew Rybchenko Cc: Xiaoyu Min , Thomas Monjalon , Ferruh Yigit , dev@dpdk.org Message-ID: <20190514090034.GN4284@6wind.com> References: <20190514071829.5251-1-jackmin@mellanox.com> <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> Subject: Re: [dpdk-dev] [RFC] ethdev: add GRE optional fields to flow API 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: , X-List-Received-Date: Tue, 14 May 2019 09:00:37 -0000 On Tue, May 14, 2019 at 10:34:22AM +0300, Andrew Rybchenko wrote: > On 5/14/19 10:18 AM, Xiaoyu Min wrote: > > Add GRE's checksum, key, and sequence field to the > > struct rte_flow_item_gre in order to match. > > > > Signed-off-by: Xiaoyu Min > > --- > > lib/librte_ethdev/rte_flow.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > > index 63f84fca65..fb04af3268 100644 > > --- a/lib/librte_ethdev/rte_flow.h > > +++ b/lib/librte_ethdev/rte_flow.h > > @@ -847,6 +847,10 @@ struct rte_flow_item_gre { > > */ > > rte_be16_t c_rsvd0_ver; > > rte_be16_t protocol; /**< Protocol type. */ > > + rte_be16_t checksum; /**< chksum for the header and payload, optional.*/ > > + rte_be16_t rsvd1; /**< present when C bit is set, optional. */ > > + rte_be32_t key; /**< application specific key value, optional. */ > > + rte_be32_t sequence; /**< sequence num for the GRE packet, optional. */ > > }; > > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > > What is the purpose to match checksum, reserved and sequence number? I think it's not really an issue, this structure only describes a packet header as found on the wire like other pattern items; rte_flow users only have to provide a mask to select the fields to be matched. However you can't just modify an existing public structure without going through the lengthy API/ABI deprecation/versioning process. The reason these fields were not initially part of rte_flow_item_gre is that each of them is optional, meaning the GRE header has variable length. They should be handled through separate objects like IPv6 options (struct rte_flow_item_ipv6_ext), ARP (struct rte_flow_item_arp_eth_ipv4) or ICMPv6 neighbor discovery (struct rte_flow_item_icmp6_nd_opt), either all together e.g.: RTE_FLOW_ITEM_TYPE_GRE_OPTS struct rte_flow_item_gre_opts { rte_be16_t checksum; /**< Checksum for GRE header and payload (C bit). */ rte_be16_t rsvd1; /**< Reserved bits (C bit). */ rte_be32_t key; /**< Application specific key value (K bit). */ rte_be32_t sequence; /**< Sequence number for GRE packet (S bit). */ }; Or separately, since I guess only key matters no need to define the others: RTE_FLOW_ITEM_TYPE_GRE_KEY struct rte_flow_item_gre_key { rte_be32_t key; /**< Application specific key value (K bit). */ }; In both cases, the default mask for this object should cover "key". Make sure to update documentation and testpmd in the same patch. -- Adrien Mazarguil 6WIND From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 15CEEA00E6 for ; Tue, 14 May 2019 11:00:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C92625A4A; Tue, 14 May 2019 11:00:37 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id EAFAC568A for ; Tue, 14 May 2019 11:00:36 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id r7so420351wrr.13 for ; Tue, 14 May 2019 02:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gZjO8bVtZ6hcNFCWG9Q/PlPubleo8GBvqXuQ8OwGC4Y=; b=CAiIt0cgTv+TbutBJ1PybaPWlewaUg0XW3jR8RnwLE7c6de61V6nDH8eejiY3YHmMo wK5OBhQtpKOYE7WLtD27v3zAsYv8mFyPJrJCiXOxMkI4dxKX4dF76cflah9R9nIjrkgt v1D9U1atRY0h1b3l4avFPBGRQ/WVbnnYSm3tGogwQzRovwTxJRpfrKdRArl7u9yJSy1P c0WBRbgTg9o370Mn4GMY2yUKUt28UI+r871mkATXahbWpNxbDznu4WFNR71ur1UlJrP1 dG/H2PHSE87abAfTU+AiAc4gqQRvpraziAbRS1UR+RSU/ZI1uYY9LlUrQl4ENV5AIBPM PTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gZjO8bVtZ6hcNFCWG9Q/PlPubleo8GBvqXuQ8OwGC4Y=; b=BOKKBtqZXFCxRLK9sq0g4Da7v/jyQMqZWnDXo/Iq7nCmutQrLz6yt4UqVQMIi6lQIl sFPNhmZFigri6hORHicTma2yMNSyxTGoEetUiaTVnFYQzXVFTjdUfJyRTShHsXuVt4f5 mVfOgBacAmonuRfPiWEfLfzGzaOKsleXPY7gSNGyEiKKMKvm3hG4SOeXXMRR+Ut6iKhn Q7PysQPejqUVfgnJmFTovRmrQigM5roy/+S9M2SqiE0LfXpayuJfxADQ2LuDHnftmosg FbYphmBhhvEZdOLFRJTGIgrn9SSvUWrHrTt3xIhhvp+tnHvU4PAIW7PPyXOcTdQRVNod JQ6w== X-Gm-Message-State: APjAAAUEUQBWoqEVuqjqVm3kvWToj2Eo+WMOBCzyZio2c/oDPoSqp+OV Z7zHdiBKBtVLU4wMJEbpbpuq6Q== X-Google-Smtp-Source: APXvYqyrPu2LIJH3IZRvUH5utk8uD6vpS4i6oGJFVA+tCLt7VriUX/giM2An4aOLq304YKj5rG8Jjg== X-Received: by 2002:adf:e404:: with SMTP id g4mr20214250wrm.161.1557824436700; Tue, 14 May 2019 02:00:36 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f6sm1718302wmh.13.2019.05.14.02.00.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 02:00:35 -0700 (PDT) Date: Tue, 14 May 2019 11:00:34 +0200 From: Adrien Mazarguil To: Andrew Rybchenko Cc: Xiaoyu Min , Thomas Monjalon , Ferruh Yigit , dev@dpdk.org Message-ID: <20190514090034.GN4284@6wind.com> References: <20190514071829.5251-1-jackmin@mellanox.com> <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> Subject: Re: [dpdk-dev] [RFC] ethdev: add GRE optional fields to flow API 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" Message-ID: <20190514090034.gMJVJi80ZTmAIZyFJhsL6UjsiYRrgMVZJTU8xH77MUc@z> On Tue, May 14, 2019 at 10:34:22AM +0300, Andrew Rybchenko wrote: > On 5/14/19 10:18 AM, Xiaoyu Min wrote: > > Add GRE's checksum, key, and sequence field to the > > struct rte_flow_item_gre in order to match. > > > > Signed-off-by: Xiaoyu Min > > --- > > lib/librte_ethdev/rte_flow.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > > index 63f84fca65..fb04af3268 100644 > > --- a/lib/librte_ethdev/rte_flow.h > > +++ b/lib/librte_ethdev/rte_flow.h > > @@ -847,6 +847,10 @@ struct rte_flow_item_gre { > > */ > > rte_be16_t c_rsvd0_ver; > > rte_be16_t protocol; /**< Protocol type. */ > > + rte_be16_t checksum; /**< chksum for the header and payload, optional.*/ > > + rte_be16_t rsvd1; /**< present when C bit is set, optional. */ > > + rte_be32_t key; /**< application specific key value, optional. */ > > + rte_be32_t sequence; /**< sequence num for the GRE packet, optional. */ > > }; > > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > > What is the purpose to match checksum, reserved and sequence number? I think it's not really an issue, this structure only describes a packet header as found on the wire like other pattern items; rte_flow users only have to provide a mask to select the fields to be matched. However you can't just modify an existing public structure without going through the lengthy API/ABI deprecation/versioning process. The reason these fields were not initially part of rte_flow_item_gre is that each of them is optional, meaning the GRE header has variable length. They should be handled through separate objects like IPv6 options (struct rte_flow_item_ipv6_ext), ARP (struct rte_flow_item_arp_eth_ipv4) or ICMPv6 neighbor discovery (struct rte_flow_item_icmp6_nd_opt), either all together e.g.: RTE_FLOW_ITEM_TYPE_GRE_OPTS struct rte_flow_item_gre_opts { rte_be16_t checksum; /**< Checksum for GRE header and payload (C bit). */ rte_be16_t rsvd1; /**< Reserved bits (C bit). */ rte_be32_t key; /**< Application specific key value (K bit). */ rte_be32_t sequence; /**< Sequence number for GRE packet (S bit). */ }; Or separately, since I guess only key matters no need to define the others: RTE_FLOW_ITEM_TYPE_GRE_KEY struct rte_flow_item_gre_key { rte_be32_t key; /**< Application specific key value (K bit). */ }; In both cases, the default mask for this object should cover "key". Make sure to update documentation and testpmd in the same patch. -- Adrien Mazarguil 6WIND