From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8C2DF8173 for ; Sat, 11 Oct 2014 09:12:43 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 11 Oct 2014 00:17:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,697,1406617200"; d="scan'208";a="587159525" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 11 Oct 2014 00:20:11 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sat, 11 Oct 2014 00:20:10 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.192]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.172]) with mapi id 14.03.0195.001; Sat, 11 Oct 2014 15:20:09 +0800 From: "Chen, Jing D" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [PATCH] lib/librte_pmd_i40e: i40e vlan filter set fix Thread-Index: AQHP2t/78EzTkiBhKkSNq5TdMj9ljZwqkVQA Date: Sat, 11 Oct 2014 07:20:08 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D015F2482@shsmsx102.ccr.corp.intel.com> References: <1411883352-22166-1-git-send-email-huawei.xie@intel.com> In-Reply-To: <1411883352-22166-1-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] lib/librte_pmd_i40e: i40e vlan filter set 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: Sat, 11 Oct 2014 07:12:44 -0000 > -----Original Message----- > From: Xie, Huawei > Sent: Sunday, September 28, 2014 1:49 PM > To: dev@dpdk.org > Cc: Xie, Huawei; Chen, Jing D; Zhang, Helin > Subject: [PATCH] lib/librte_pmd_i40e: i40e vlan filter set fix >=20 > the right shift bits should be 5 rather than 4. > vid_idx =3D (uint32_t) ((vlan_id >> 5 ) & 0x7F) >=20 > Signed-off-by: Huawei Xie > CC: Jing Chen > CC: Helin Zhang >=20 > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index 9009bd4..9c9d831 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -3786,14 +3786,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, > { > uint32_t vid_idx, vid_bit; >=20 > -#define UINT32_BIT_MASK 0x1F > -#define VALID_VLAN_BIT_MASK 0xFFF > /* VFTA is 32-bits size array, each element contains 32 vlan bits, Find > 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 >> 5 ) & 0x7F); > + vid_bit =3D (uint32_t) (1 << (vlan_id & 0x1F)); >=20 > if (on) > vsi->vfta[vid_idx] |=3D vid_bit; > -- > 1.8.1.4 Please try to use macro to replace numbers.