From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D75D47CD9 for ; Mon, 5 Jun 2017 07:42:03 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2017 22:42:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,299,1493708400"; d="scan'208";a="1178310203" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 04 Jun 2017 22:42:02 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 4 Jun 2017 22:42:01 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 4 Jun 2017 22:42:01 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Mon, 5 Jun 2017 13:42:00 +0800 From: "Lu, Wenzhuo" To: "Zhao1, Wei" , "dev@dpdk.org" Thread-Topic: [PATCH v2 10/11] net/e1000: destroy consistent filter Thread-Index: AQHS22vfCpDf5EAp/06OBV8Pa8EGeqIVxZeg Date: Mon, 5 Jun 2017 05:41:59 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B5CBE44@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-11-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1496385391-12445-11-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 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 05:42:04 -0000 Hi Wei, > -----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 >=20 > This patch adds a function to destroy the flow fliter. >=20 > Signed-off-by: Wei Zhao > --- > drivers/net/e1000/igb_flow.c | 100 > ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 99 insertions(+), 1 deletion(-) >=20 > 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; > } >=20 > +/* 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 directl= y for deleting?=20 The same below. > + if (!ret) { > + TAILQ_REMOVE(&igb_filter_ntuple_list, > + ntuple_filter_ptr, entries); > + rte_free(ntuple_filter_ptr); > + } > + break;