From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 88EB78001 for ; Mon, 24 Nov 2014 09:22:08 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 24 Nov 2014 00:32:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,447,1413270000"; d="scan'208";a="637053520" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by fmsmga002.fm.intel.com with ESMTP; 24 Nov 2014 00:32:42 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 24 Nov 2014 16:32:41 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0195.001; Mon, 24 Nov 2014 16:32:40 +0800 From: "Qiu, Michael" To: "Xie, Huawei" , "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/2] lib/librte_pmd_i40e: set vlan filter fix Thread-Index: AQHP/JCs+8mIh8By/km8c+FbsyOugQ== Date: Mon, 24 Nov 2014 08:32:38 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286C99F7A@SHSMSX101.ccr.corp.intel.com> References: <1415587563-11512-1-git-send-email-huawei.xie@intel.com> <1415587563-11512-2-git-send-email-huawei.xie@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/2] lib/librte_pmd_i40e: set vlan filter fix X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2014 08:22:09 -0000 On 11/10/2014 2:42 PM, Xie, Huawei wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: Zhang, Helin=0A= >> Sent: Sunday, November 09, 2014 10:09 PM=0A= >> To: Xie, Huawei; dev@dpdk.org=0A= >> Subject: RE: [dpdk-dev] [PATCH v2 1/2] lib/librte_pmd_i40e: set vlan fil= ter fix=0A= >>=0A= >>=0A= >>=0A= >>> -----Original Message-----=0A= >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie=0A= >>> Sent: Monday, November 10, 2014 10:46 AM=0A= >>> To: dev@dpdk.org=0A= >>> Subject: [dpdk-dev] [PATCH v2 1/2] lib/librte_pmd_i40e: set vlan filter= fix=0A= >>>=0A= >>> ">> 5" rather than ">> 4"=0A= >>>=0A= >>> Signed-off-by: Huawei Xie =0A= >>> ---=0A= >>> lib/librte_pmd_i40e/i40e_ethdev.c | 7 ++-----=0A= >>> 1 file changed, 2 insertions(+), 5 deletions(-)=0A= >>>=0A= >>> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> b/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> index 5074262..c0cf3cf 100644=0A= >>> --- a/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> @@ -4048,14 +4048,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, {= =0A= >>> uint32_t vid_idx, vid_bit;=0A= >>>=0A= >>> -#define UINT32_BIT_MASK 0x1F=0A= >>> -#define VALID_VLAN_BIT_MASK 0xFFF=0A= >>> /* VFTA is 32-bits size array, each element contains 32 vlan bits, Fi= nd the=0A= >>> * element first, then find the bits it belongs to=0A= >>> */=0A= >>> - vid_idx =3D (uint32_t) ((vlan_id & VALID_VLAN_BIT_MASK) >>=0A= >>> - sizeof(uint32_t));=0A= >>> - vid_bit =3D (uint32_t) (1 << (vlan_id & UINT32_BIT_MASK));=0A= >>> + vid_idx =3D (uint32_t) ((vlan_id >> 5 ) & 0x7F);=0A= =0A= = =0A= ^^^^^^^^^^^^=0A= =0A= No need additional space after '5'=0A= >>> + vid_bit =3D (uint32_t) (1 << (vlan_id & 0x1F));=0A= >> I don't understand why remove macros and use numeric instead?=0A= > Those macros are wrongly defined. Correct macros are defined in second pa= tch.=0A= =0A= Is there any issue to swap your patch order, and use your defined macros=0A= here? That would be much better if no other issue.=0A= =0A= Thanks,=0A= Michael=0A= >>> if (on)=0A= >>> vsi->vfta[vid_idx] |=3D vid_bit;=0A= >>> --=0A= >>> 1.8.1.4=0A= >> Regards,=0A= >> Helin=0A= =0A=