[dpdk-dev] [PATCH v2 03/17] net/i40e: store flow director filter

Tiwei Bie tiwei.bie at intel.com
Wed Dec 28 08:14:55 CET 2016


On Wed, Dec 28, 2016 at 03:10:39PM +0800, Xing, Beilei wrote:
> 
> 
> > -----Original Message-----
> > From: Bie, Tiwei
> > Sent: Wednesday, December 28, 2016 11:39 AM
> > To: Xing, Beilei <beilei.xing at intel.com>
> > Cc: Wu, Jingjing <jingjing.wu at intel.com>; Zhang, Helin
> > <helin.zhang at intel.com>; dev at dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2 03/17] net/i40e: store flow director filter
> > 
> > On Tue, Dec 27, 2016 at 02:26:10PM +0800, Beilei Xing wrote:
> > > Currently there's no flow director filter stored in SW. This patch
> > > stores flow director filters in SW with cuckoo hash, also adds
> > > protection if a flow director filter has been added.
> > >
> > > Signed-off-by: Beilei Xing <beilei.xing at intel.com>
> > > ---
> > >  drivers/net/i40e/i40e_ethdev.c | 48 +++++++++++++++++++++
> > > drivers/net/i40e/i40e_ethdev.h | 12 ++++++
> > >  drivers/net/i40e/i40e_fdir.c   | 98
> > ++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 158 insertions(+)
> > >
> > > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > > b/drivers/net/i40e/i40e_ethdev.c index c012d5d..427ebdc 100644
> > > --- a/drivers/net/i40e/i40e_ethdev.c
> > > +++ b/drivers/net/i40e/i40e_ethdev.c
> > [...]
> > > @@ -1342,6 +1379,17 @@ eth_i40e_dev_uninit(struct rte_eth_dev *dev)
> > >  		rte_free(p_tunnel);
> > >  	}
> > >
> > > +	/* Remove all flow director rules and hash */
> > > +	if (fdir_info->hash_map)
> > > +		rte_free(fdir_info->hash_map);
> > > +	if (fdir_info->hash_table)
> > > +		rte_hash_free(fdir_info->hash_table);
> > > +
> > > +	while ((p_fdir = TAILQ_FIRST(&fdir_info->fdir_list))) {
> > 
> > There is a redundant pair of parentheses, or you should compare with NULL.
> 
> I think the another parentheses is used to compare with NULL. In fact there's similar using in PMD.
> 

The outer parentheses are redundant unless you compare it with NULL explicitly.
Any way, you could just follow the existing coding style.

Best regards,
Tiwei Bie


More information about the dev mailing list