From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 232E27E75 for ; Thu, 4 Dec 2014 11:25:39 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 04 Dec 2014 02:25:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="424978124" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2014 02:15:16 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 4 Dec 2014 18:25:34 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.216]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0195.001; Thu, 4 Dec 2014 18:25:32 +0800 From: "Chen, Jing D" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] i40e: Fix a vlan bug Thread-Index: AQHQD6e5LtHHrZY+mk2pPcece2l9IZx/ObjQ Date: Thu, 4 Dec 2014 10:25:32 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D0162B293@shsmsx102.ccr.corp.intel.com> References: <1417686605-6778-1-git-send-email-jing.d.chen@intel.com> <533710CFB86FA344BFBF2D6802E60286C9CAEC@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9CAEC@SHSMSX101.ccr.corp.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] i40e: Fix a vlan bug 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: Thu, 04 Dec 2014 10:25:40 -0000 Yes, the same to his. As he is in vacation, I'd like to send out patch for = him. > -----Original Message----- > From: Qiu, Michael > Sent: Thursday, December 04, 2014 6:19 PM > To: Chen, Jing D; dev@dpdk.org > Cc: Xie, Huawei > Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug >=20 > Hi Mark, >=20 > I think Huawei (huawei.xie@intel.com) has one patch set to fix this issue= . >=20 > If your patch is totally different with him: >=20 > [dpdk-dev] [PATCH v4 0/2] lib/librte_pmd_i40e: set vlan filter fix >=20 > please ignore my comments :) >=20 > But you both calculation are different. >=20 > Thanks, > Michael > On 12/4/2014 5:51 PM, Chen Jing D(Mark) wrote: > > From: "Chen Jing D(Mark)" > > > > i40e uses an bitmap array to store those vlan tags that are set by > > application. In function i40e_set_vlan_filter, it stores vlan tag > > to wrong place. This change will fix it. > > > > Signed-off-by: Chen Jing D(Mark) > > --- > > lib/librte_pmd_i40e/i40e_ethdev.c | 11 ++++------- > > 1 files changed, 4 insertions(+), 7 deletions(-) > > > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > > index 87e750a..cebc21d 100644 > > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > > @@ -4163,8 +4163,8 @@ i40e_find_vlan_filter(struct i40e_vsi *vsi, > > { > > uint32_t vid_idx, vid_bit; > > > > - vid_idx =3D (uint32_t) ((vlan_id >> 5) & 0x7F); > > - vid_bit =3D (uint32_t) (1 << (vlan_id & 0x1F)); > > + vid_idx =3D (uint32_t)(vlan_id / I40E_UINT32_BIT_SIZE); > > + vid_bit =3D (uint32_t)(1 << (vlan_id % I40E_UINT32_BIT_SIZE)); > > > > if (vsi->vfta[vid_idx] & vid_bit) > > return 1; > > @@ -4178,14 +4178,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, > > { > > uint32_t vid_idx, vid_bit; > > > > -#define UINT32_BIT_MASK 0x1F > > -#define VALID_VLAN_BIT_MASK 0xFFF > > /* VFTA is 32-bits size array, each element contains 32 vlan bits, Fi= nd > the > > * element first, then find the bits it belongs to > > */ > > - vid_idx =3D (uint32_t) ((vlan_id & VALID_VLAN_BIT_MASK) >> > > - sizeof(uint32_t)); > > - vid_bit =3D (uint32_t) (1 << (vlan_id & UINT32_BIT_MASK)); > > + vid_idx =3D (uint32_t)(vlan_id / I40E_UINT32_BIT_SIZE); > > + vid_bit =3D (uint32_t)(1 << (vlan_id % I40E_UINT32_BIT_SIZE)); > > > > if (on) > > vsi->vfta[vid_idx] |=3D vid_bit;