From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 7A6EF5907 for ; Thu, 6 Nov 2014 09:28:00 +0100 (CET) Received: by mail-wi0-f179.google.com with SMTP id h11so737162wiw.6 for ; Thu, 06 Nov 2014 00:37:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=8wcK6+RRns4sgvZP3i7fBencTY7DPNBxKx7cFmzpGko=; b=LBQeENtrriiWSqW89A3nyPKXD2iwRjgGSUYBxwqNbn8ebFaWOjV8Y7B2U1KPr5hfzq F5MMND+m9uGglyb/N/b36CraL8hi9vMztToBDNwn0Txrfh/pY0JRFqx/EBH/t12X6PIq xM4Tbuttwgcow4CuYO0PVyGcDZxlx2FeOTljC1sHraPPvvB1GF8o/r0gmn3mZhSU/ipz dtIF21SUGTvHhC5J0/u6Eb/nq+9Z3BetGkLMWehLZBkxtFsiNer9GBdR82XDA5bpLswj rmyFWgE449dQj8pGHTmhAzX6Y7y5k+0mJAtowvJP6T0abEf/7fWraD6LoNYlcl/3WoNV snzQ== X-Gm-Message-State: ALoCoQlPc6O9ySGhnQpYWaj/DkoX9QLgud3vTxd3P1AXXdeIoXXfYoniRM5GSa+hkPVPq7iDSxky X-Received: by 10.180.212.42 with SMTP id nh10mr38262101wic.52.1415263047077; Thu, 06 Nov 2014 00:37:27 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id ci9sm7377549wid.24.2014.11.06.00.37.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 00:37:26 -0800 (PST) From: Thomas Monjalon To: "Xie, Huawei" Date: Thu, 06 Nov 2014 09:37:08 +0100 Message-ID: <5037229.OQFgQMz1y9@xps13> Organization: 6WIND User-Agent: KMail/4.14.2 (Linux/3.17.2-1-ARCH; KDE/4.14.2; x86_64; ; ) In-Reply-To: References: <1411883352-22166-1-git-send-email-huawei.xie@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org 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: Thu, 06 Nov 2014 08:28:00 -0000 2014-11-06 00:22, Xie, Huawei: > Thomas, comments for this patch? No, but Jing Chen made some comments that you didn't replied: "Please try to use macro to replace numbers." So I wait a v2. > > -----Original Message----- > > From: Xie, Huawei > > Sent: Saturday, September 27, 2014 10: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 > > > > the right shift bits should be 5 rather than 4. > > vid_idx = (uint32_t) ((vlan_id >> 5 ) & 0x7F) > > > > Signed-off-by: Huawei Xie > > CC: Jing Chen > > CC: Helin Zhang > > > > --- > > lib/librte_pmd_i40e/i40e_ethdev.c | 7 ++----- > > 1 file changed, 2 insertions(+), 5 deletions(-) > > > > 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; > > > > -#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 = (uint32_t) ((vlan_id & VALID_VLAN_BIT_MASK) >> > > - sizeof(uint32_t)); > > - vid_bit = (uint32_t) (1 << (vlan_id & UINT32_BIT_MASK)); > > + vid_idx = (uint32_t) ((vlan_id >> 5 ) & 0x7F); > > + vid_bit = (uint32_t) (1 << (vlan_id & 0x1F)); > > > > if (on) > > vsi->vfta[vid_idx] |= vid_bit; > > -- > > 1.8.1.4