From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EFF927CE3 for ; Fri, 2 Jun 2017 10:00:58 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2017 01:00:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,284,1493708400"; d="scan'208";a="108329046" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga005.jf.intel.com with ESMTP; 02 Jun 2017 01:00:56 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.82]) by PGSMSX104.gar.corp.intel.com ([169.254.3.151]) with mapi id 14.03.0319.002; Fri, 2 Jun 2017 16:00:55 +0800 From: "Zhao1, Wei" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [PATCH v2 02/11] net/e1000: restore n-tuple filter Thread-Index: AQHS22veJr/jIq8/Y06j9HvcVWLUkKIQrpOAgACG68A= Date: Fri, 2 Jun 2017 08:00:54 +0000 Message-ID: References: <1495523581-56027-1-git-send-email-wei.zhao1@intel.com> <1496385391-12445-1-git-send-email-wei.zhao1@intel.com> <1496385391-12445-3-git-send-email-wei.zhao1@intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B5CB1DA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B5CB1DA@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 02/11] net/e1000: restore n-tuple filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 08:00:59 -0000 Hi, wenzhuo > -----Original Message----- > From: Lu, Wenzhuo > Sent: Friday, June 2, 2017 3:57 PM > To: Zhao1, Wei ; dev@dpdk.org > Subject: RE: [PATCH v2 02/11] net/e1000: restore n-tuple filter >=20 > Hi Wei, >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Friday, June 2, 2017 2:36 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo; Zhao1, Wei > > Subject: [PATCH v2 02/11] net/e1000: restore n-tuple filter > > > > Add support for restoring n-tuple > > filter in SW. > > > > Signed-off-by: Wei Zhao > > --- > > drivers/net/e1000/igb_ethdev.c | 262 > > +++++++++++++++++++++++++------------ > > ---- > > 1 file changed, 159 insertions(+), 103 deletions(-) > > > > diff --git a/drivers/net/e1000/igb_ethdev.c > > b/drivers/net/e1000/igb_ethdev.c index 1077870..1e321d6 100644 > > --- a/drivers/net/e1000/igb_ethdev.c > > +++ b/drivers/net/e1000/igb_ethdev.c > > @@ -757,6 +757,35 @@ igb_reset_swfw_lock(struct e1000_hw *hw) > > return E1000_SUCCESS; > > } > > > > +/* Remove all ntuple filters of the device */ static int > > +igb_ntuple_filter_uninit(struct rte_eth_dev *eth_dev) { > > + struct e1000_filter_info *filter_info =3D > > + E1000_DEV_PRIVATE_TO_FILTER_INFO(eth_dev->data- > > >dev_private); > > + > > + struct e1000_5tuple_filter *p_5tuple, *p_5tuple_next; > > + struct e1000_2tuple_filter *p_2tuple, *p_2tuple_next; > > + > > + for (p_5tuple =3D TAILQ_FIRST(&filter_info->fivetuple_list); > > + p_5tuple !=3D NULL; p_5tuple =3D p_5tuple_next) { > > + p_5tuple_next =3D TAILQ_NEXT(p_5tuple, entries); > > + TAILQ_REMOVE(&filter_info->fivetuple_list, > > + p_5tuple, entries); > > + rte_free(p_5tuple); > > + } > I know you don't change this code. It's moved here. But this implementati= on > is complex and not friendly. Would you like to change it to, > while ((p_5tuple =3D TAILQ_FIRST(&filter_info->fivetuple_list))) { > TAILQ_REMOVE(&filter_info->fivetuple_list, > p_5tuple, entries); > rte_free(p_5tuple); > } > The same below. Ok, I will change as your suggestion in v3 later. >=20 > > + filter_info->fivetuple_mask =3D 0; > > + for (p_2tuple =3D TAILQ_FIRST(&filter_info->twotuple_list); > > + p_2tuple !=3D NULL; p_2tuple =3D p_2tuple_next) { > > + p_2tuple_next =3D TAILQ_NEXT(p_2tuple, entries); > > + TAILQ_REMOVE(&filter_info->twotuple_list, > > + p_2tuple, entries); > > + rte_free(p_2tuple); > > + } > > + filter_info->twotuple_mask =3D 0; > > + > > + return 0; > > +}