From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5F4FE7CE1 for ; Mon, 5 Jun 2017 08:00:59 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2017 23:00:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,299,1493708400"; d="scan'208";a="864587316" Received: from kmsmsx155.gar.corp.intel.com ([172.21.73.106]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jun 2017 23:00:57 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.82]) by KMSMSX155.gar.corp.intel.com ([169.254.15.19]) with mapi id 14.03.0319.002; Mon, 5 Jun 2017 14:00:55 +0800 From: "Zhao1, Wei" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [PATCH v2 10/11] net/e1000: destroy consistent filter Thread-Index: AQHS22vhBkQKt9snlEmWPvA6c2qNy6IVP/GAgACKrOA= Date: Mon, 5 Jun 2017 06: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-11-git-send-email-wei.zhao1@intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B5CBE44@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B5CBE44@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.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 10/11] net/e1000: destroy consistent 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: Mon, 05 Jun 2017 06:00:59 -0000 Hi, wenzhuo > -----Original Message----- > From: Lu, Wenzhuo > Sent: Monday, June 5, 2017 1:42 PM > To: Zhao1, Wei ; dev@dpdk.org > Subject: RE: [PATCH v2 10/11] net/e1000: destroy consistent filter >=20 > Hi Wei, >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Friday, June 2, 2017 2:37 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo; Zhao1, Wei > > Subject: [PATCH v2 10/11] net/e1000: destroy consistent filter > > > > This patch adds a function to destroy the flow fliter. > > > > Signed-off-by: Wei Zhao > > --- > > drivers/net/e1000/igb_flow.c | 100 > > ++++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 99 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/e1000/igb_flow.c > > b/drivers/net/e1000/igb_flow.c index fac76bf..bced291 100644 > > --- a/drivers/net/e1000/igb_flow.c > > +++ b/drivers/net/e1000/igb_flow.c > > @@ -1464,10 +1464,108 @@ igb_flow_validate(__rte_unused struct > > rte_eth_dev *dev, > > return ret; > > } > > > > +/* Destroy a flow rule on igb. */ > > +static int > > +igb_flow_destroy(struct rte_eth_dev *dev, > > + struct rte_flow *flow, > > + struct rte_flow_error *error) > > +{ > > + int ret; > > + struct rte_flow *pmd_flow =3D flow; > > + enum rte_filter_type filter_type =3D pmd_flow->filter_type; > > + struct rte_eth_ntuple_filter ntuple_filter; > > + struct rte_eth_ethertype_filter ethertype_filter; > > + struct rte_eth_syn_filter syn_filter; > > + struct rte_eth_flex_filter flex_filter; > > + struct igb_ntuple_filter_ele *ntuple_filter_ptr; > > + struct igb_ethertype_filter_ele *ethertype_filter_ptr; > > + struct igb_eth_syn_filter_ele *syn_filter_ptr; > > + struct igb_flex_filter_ele *flex_filter_ptr; > > + struct igb_flow_mem *igb_flow_mem_ptr; > > + > > + switch (filter_type) { > > + case RTE_ETH_FILTER_NTUPLE: > > + ntuple_filter_ptr =3D (struct igb_ntuple_filter_ele *) > > + pmd_flow->rule; > > + (void)rte_memcpy(&ntuple_filter, > > + &ntuple_filter_ptr->filter_info, > > + sizeof(struct rte_eth_ntuple_filter)); > > + ret =3D igb_add_del_ntuple_filter(dev, &ntuple_filter, FALSE); > Is a copy necessary? Could "ntuple_filter_ptr->filter_info" be used direc= tly > for deleting? > The same below. Maybe this is ok? ntuple_filter_ptr =3D (struct igb_ntuple_filter_ele *) pmd_flow->rule; ret =3D igb_add_del_ntuple_filter(dev, &ntuple_filter_ptr->filter_info, FA= LSE); >=20 > > + if (!ret) { > > + TAILQ_REMOVE(&igb_filter_ntuple_list, > > + ntuple_filter_ptr, entries); > > + rte_free(ntuple_filter_ptr); > > + } > > + break;