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 73D4EA04B5; Mon, 16 Nov 2020 17:13:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACDC9323E; Mon, 16 Nov 2020 17:13:02 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 822042C16 for ; Mon, 16 Nov 2020 17:13:01 +0100 (CET) IronPort-SDR: i65Q2xekdmU7z6KuQE2p2A0GBjPwu75fk6Y8ewEOgUpIgStlBVyD4dndKsL1MlCEozxdxcx4On O7RVQa4FYAdA== X-IronPort-AV: E=McAfee;i="6000,8403,9807"; a="157794859" X-IronPort-AV: E=Sophos;i="5.77,483,1596524400"; d="scan'208";a="157794859" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2020 08:12:58 -0800 IronPort-SDR: l9BmFeXaooB0LDL5QH1DeqrgPImZcwKJuVDy6hDrRma0Ypuw/hO2sIGAhjPvrwzOWp5qw6cD9d I4KrQx3Fgglg== X-IronPort-AV: E=Sophos;i="5.77,483,1596524400"; d="scan'208";a="475574662" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.227.57]) ([10.213.227.57]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2020 08:12:57 -0800 To: Xiaoyu Min , Ajit Khaparde , Somnath Kotur Cc: dev@dpdk.org, Xiaoyu Min References: <141eb0140301108b1320ecfd93c89e48b02cd546.1605493464.git.jackmin@nvidia.com> From: Ferruh Yigit Message-ID: Date: Mon, 16 Nov 2020 16:12:53 +0000 MIME-Version: 1.0 In-Reply-To: <141eb0140301108b1320ecfd93c89e48b02cd546.1605493464.git.jackmin@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 3/5] net/bnxt: fix protocol size for VXLAN encap copy 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:55 AM, Xiaoyu Min wrote: > From: Xiaoyu Min > > The rte_flow_item_eth and rte_flow_item_vlan items are refined. > The structs do not exactly represent the packet bits captured on the > wire anymore so should only copy real header instead of the whole struct. > > Replace the rte_flow_item_* with the existing corresponding rte_*_hdr. > > Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items") > > Signed-off-by: Xiaoyu Min <...> > @@ -1726,7 +1727,7 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item, > BNXT_TF_DBG(ERR, "vxlan encap does not have vni\n"); > return BNXT_TF_RC_ERROR; > } > - vxlan_size = sizeof(struct rte_flow_item_vxlan); > + vxlan_size = sizeof(struct rte_vxlan_hdr); > /* copy the vxlan details */ > memcpy(&vxlan_spec, item->spec, vxlan_size); > vxlan_spec.flags = 0x08; > 'vxlan_size' seems used both to copy rt_flow_item [1] and to header [2]. Also ''vxlan_size' is used to copy the 'vxlan_spec'. Since both "struct rte_flow_item_vxlan" & "struct rte_vxlan_hdr" size is same, this should work fine, but I guess it may be broken if sizes of those two structures changes in the future. [1] memcpy(&vxlan_spec, item->spec, vxlan_size); [2] ulp_encap_buffer_copy(buff, (const uint8_t *)&vxlan_spec, vxlan_size, ULP_BUFFER_ALIGN_8_BYTE);