From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v2 03/17] net/i40e: store flow director filter Date: Wed, 28 Dec 2016 15:36:09 +0800 Message-ID: <20161228073608.GA134381@dpdk19> References: <1480679625-4157-1-git-send-email-beilei.xing@intel.com> <1482819984-14120-1-git-send-email-beilei.xing@intel.com> <1482819984-14120-4-git-send-email-beilei.xing@intel.com> <20161228033847.GB13841@dpdk19> <94479800C636CB44BD422CB454846E013158BFAF@SHSMSX101.ccr.corp.intel.com> <20161228071455.GB85898@dpdk19> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: "Wu, Jingjing" , "Zhang, Helin" , "dev@dpdk.org" To: "Xing, Beilei" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5F18E376C for ; Wed, 28 Dec 2016 08:41:33 +0100 (CET) Content-Disposition: inline In-Reply-To: <20161228071455.GB85898@dpdk19> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Dec 28, 2016 at 03:14:55PM +0800, Tiwei Bie wrote: > 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 > > > Cc: Wu, Jingjing ; Zhang, Helin > > > ; 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 > > > > --- > > > > 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. > Sorry, I was wrong here. I just did a quick check and noticed that DPDK has enabled the below option: -Werror=parentheses The outer parentheses are NOT redundant even if you don't compare it with NULL explicitly. Best regards, Tiwei Bie