From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 28BED5909
 for <dev@dpdk.org>; Tue, 25 Nov 2014 09:39:01 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga103.jf.intel.com with ESMTP; 25 Nov 2014 00:46:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.07,454,1413270000"; d="scan'208";a="613609124"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.15])
 by orsmga001.jf.intel.com with SMTP; 25 Nov 2014 00:49:50 -0800
Received: by  (sSMTP sendmail emulation); Tue, 25 Nov 2014 08:49:49 +0025
Date: Tue, 25 Nov 2014 08:49:49 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Huawei Xie <huawei.xie@intel.com>
Message-ID: <20141125084949.GC6696@bricha3-MOBL3>
References: <1416900537-15912-1-git-send-email-huawei.xie@intel.com>
 <1416900537-15912-2-git-send-email-huawei.xie@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1416900537-15912-2-git-send-email-huawei.xie@intel.com>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 1/2] lib/librte_pmd_i40e: set vlan id
 filter fix
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Nov 2014 08:39:02 -0000

On Tue, Nov 25, 2014 at 03:28:56PM +0800, Huawei Xie wrote:
> ">> 5" rather than ">> 4"

you need to provide a reference for where this value comes from. Presumably
this is based of the register description in the datasheet for the NIC, so perhaps
you can add that.

> 
> Signed-off-by: Huawei Xie <huawei.xie@intel.com>
> ---
>  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 dacf2db..518597f 100644
> --- a/lib/librte_pmd_i40e/i40e_ethdev.c
> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c
> @@ -4172,14 +4172,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
>