From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] i40e: Fix a vlan bug Date: Fri, 05 Dec 2014 10:18:45 +0100 Message-ID: <6387429.vGjKaiz9ho@xps13> References: <1417686605-6778-1-git-send-email-jing.d.chen@intel.com> <1575841.on6VhD6YKG@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Xie, Huawei" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Huawei, 2014-12-05 04:56, Xie, Huawei: > Hi Thomas: > I will continue work on this fix. > Do you have comments to the v4 patch? > For Bruce's comment, I add some descriptive commit message for the commit. > For the constant number, I define a macro as the wrapper for the VFA array index and value. > > One question is it isn't based on latest commit, but I tried applying the patch, there is no problem. > +/* > + * vlan_id is a 12 bit number. > + * The VFTA array is actually a 4096 bit array, 128 of 32bit elements. > + * 2^5 = 32. The val of lower 5 bits specifies the bit in the 32bit element. > + * The higher 7 bit val specifies VFTA array index. > + */ > +#define I40E_VFTA_BIT(vlan_id) (1 << ((vlan_id) & 0x1F)) > +#define I40E_VFTA_IDX(vlan_id) ((vlan_id) >> 5) If you replace the values by constants, it's ok for me. Note that I won't check the i40e datasheet so you need a reviewer who will do :) -- Thomas