From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 20AD27D00 for ; Fri, 2 Jun 2017 09:56:42 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 02 Jun 2017 00:56:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,284,1493708400"; d="scan'208";a="1137221133" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 02 Jun 2017 00:56:41 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 2 Jun 2017 00:56:41 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.197]) with mapi id 14.03.0319.002; Fri, 2 Jun 2017 15:56:39 +0800 From: "Lu, Wenzhuo" To: "Zhao1, Wei" , "dev@dpdk.org" Thread-Topic: [PATCH v2 02/11] net/e1000: restore n-tuple filter Thread-Index: AQHS22vbtCku2dqfZkiDWLVlH75avKIRM6FA Date: Fri, 2 Jun 2017 07:56:39 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B5CB1DA@shsmsx102.ccr.corp.intel.com> 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> In-Reply-To: <1496385391-12445-3-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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 07:56:43 -0000 Hi Wei, > -----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 >=20 > Add support for restoring n-tuple > filter in SW. >=20 > Signed-off-by: Wei Zhao > --- > drivers/net/e1000/igb_ethdev.c | 262 +++++++++++++++++++++++++----------= -- > ---- > 1 file changed, 159 insertions(+), 103 deletions(-) >=20 > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethde= v.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; > } >=20 > +/* 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 implementation= 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. > + 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; > +}