From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B0F5A04DB; Tue, 17 Nov 2020 11:30:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6FD658C4; Tue, 17 Nov 2020 11:30:21 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 65649567C for ; Tue, 17 Nov 2020 11:30:19 +0100 (CET) IronPort-SDR: C69MeJXP3kgUppYhzGhWl4PjualVd8coSf+osFQhLg6E97nLvv0bN/HHoUO3yuU+MXKgjgw2ns iaxKHQ3dO0vw== X-IronPort-AV: E=McAfee;i="6000,8403,9807"; a="158673946" X-IronPort-AV: E=Sophos;i="5.77,485,1596524400"; d="scan'208";a="158673946" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 02:30:17 -0800 IronPort-SDR: CX1qmmLzdBu55sDrLyQMK6ZQBWodb8N2vwbr4ghL8ADjtU+/Z20rEhwDxGNiUFBFZ+kCZmWslH cquM6+ig2qHA== X-IronPort-AV: E=Sophos;i="5.77,485,1596524400"; d="scan'208";a="358845133" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.210.196]) ([10.213.210.196]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 02:30:15 -0800 To: Dekel Peled , Xiaoyu Min , Jasvinder Singh , Cristian Dumitrescu Cc: "dev@dpdk.org" References: <0bbc7b578dc8ad9348e802e2553de977805f80db.1605493464.git.jackmin@nvidia.com> <41f0fbac-59e5-bddb-3e4d-744da727bd7c@intel.com> From: Ferruh Yigit Message-ID: Date: Tue, 17 Nov 2020 10:30:12 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size calculation 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" On 11/16/2020 7:09 PM, Dekel Peled wrote: < Please don't top post, reply moved to the bottom > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Monday, November 16, 2020 6:27 PM >> To: Xiaoyu Min ; Jasvinder Singh >> ; Cristian Dumitrescu >> >> Cc: dev@dpdk.org; Dekel Peled >> Subject: Re: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size >> calculation >> >> On 11/16/2020 7:55 AM, Xiaoyu Min wrote: >>> From: Dekel Peled >>> >>> The rte_flow_item_eth and rte_flow_item_vlan items were updated in >> [1]. >>> The rte_flow_item_ipv6 item was updated in [2]. >>> The structs now contain additional metadata following the header data. >>> The size to use for match should be the header data size only, and not >>> the size of the whole struct. >>> >>> This patch replaces the rte_flow_item_* with the corresponding >> rte_*_hdr. >>> >>> [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and >>> VLAN >>> items") >>> >>> [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6 >>> item") >>> >>> Signed-off-by: Dekel Peled >>> --- >>> drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c >>> b/drivers/net/softnic/rte_eth_softnic_flow.c >>> index f05ff092fa..7925bad1c0 100644 >>> --- a/drivers/net/softnic/rte_eth_softnic_flow.c >>> +++ b/drivers/net/softnic/rte_eth_softnic_flow.c >>> @@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type >> type, >>> >>> case RTE_FLOW_ITEM_TYPE_ETH: >>> *mask = &rte_flow_item_eth_mask; >>> - *size = sizeof(struct rte_flow_item_eth); >>> + *size = sizeof(struct rte_ether_hdr); >>> return 1; /* TRUE */ >>> >>> case RTE_FLOW_ITEM_TYPE_VLAN: >>> *mask = &rte_flow_item_vlan_mask; >>> - *size = sizeof(struct rte_flow_item_vlan); >>> + *size = sizeof(struct rte_vlan_hdr); >>> return 1; >>> >>> case RTE_FLOW_ITEM_TYPE_IPV4: >>> *mask = &rte_flow_item_ipv4_mask; >>> - *size = sizeof(struct rte_flow_item_ipv4); >>> + *size = sizeof(struct rte_ipv4_hdr); >>> return 1; >>> >>> case RTE_FLOW_ITEM_TYPE_IPV6: >>> *mask = &rte_flow_item_ipv6_mask; >>> - *size = sizeof(struct rte_flow_item_ipv6); >>> + *size = sizeof(struct rte_ipv6_hdr); >>> return 1; >>> >> >> As far as I can see the 'flow_item_is_proto' sets the size to be used over >> 'rte_flow_item_*" types, the original values seems correct to me, am I >> missing something. >> >> Can you please elaborate why the change is needed? > > Hi Ferruh, > > The failure occur at hash_key_mask_is_same() which uses the size returned by flow_item_is_proto() for comparison. > Since the rte_flow_item_* of some types is now different than the rte_*_hdr size of these types, need to use the rte_*_hdr size. > Got it. Using "rte_*_hdr" structs size will strip the new additions to the "rte_flow_item_*" structs and won't able to use them. But at least using old sizes should preserve old functionality and prevent any unexpected side affect, so I am OK to continue with this change but code needs to be updated later to benefit from latest "rte_flow_item_*" structs. Cristian, Jasvinder, Can you please acknowledge that you are aware of the reason of this change and possible updates may be required later?