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.x...@intel.com> > > Cc: Wu, Jingjing <jingjing...@intel.com>; Zhang, Helin > > <helin.zh...@intel.com>; dev@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.x...@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