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 41B021B11F for ; Mon, 8 Oct 2018 17:10:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 08:10:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,357,1534834800"; d="scan'208";a="97130766" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga001.fm.intel.com with ESMTP; 08 Oct 2018 08:10:16 -0700 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.182]) by IRSMSX151.ger.corp.intel.com ([169.254.4.71]) with mapi id 14.03.0319.002; Mon, 8 Oct 2018 16:10:15 +0100 From: "Pattan, Reshma" To: "Dumitrescu, Cristian" , "dev@dpdk.org" , "Singh, Jasvinder" Thread-Topic: [PATCH v3] net/softnic: add flow flush API Thread-Index: AQHUXubz5GJKDiys3ka3tv2KciGUF6UVFr8AgABdIIA= Date: Mon, 8 Oct 2018 15:10:15 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A3B5DC6@irsmsx110.ger.corp.intel.com> References: <1538411914-12721-1-git-send-email-reshma.pattan@intel.com> <1538989812-725-1-git-send-email-reshma.pattan@intel.com> <3EB4FA525960D640B5BDFFD6A3D891268E7D5883@IRSMSX107.ger.corp.intel.com> In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891268E7D5883@IRSMSX107.ger.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: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] net/softnic: add flow flush API 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, 08 Oct 2018 15:10:19 -0000 > -----Original Message----- > From: Dumitrescu, Cristian > Sent: Monday, October 8, 2018 11:36 AM > To: Pattan, Reshma ; dev@dpdk.org; Singh, > Jasvinder > Subject: RE: [PATCH v3] net/softnic: add flow flush API >=20 >=20 >=20 > > -----Original Message----- > > From: Pattan, Reshma > > Sent: Monday, October 8, 2018 10:10 AM > > To: dev@dpdk.org; Dumitrescu, Cristian > > ; Singh, Jasvinder > > > > Cc: Pattan, Reshma > > Subject: [PATCH v3] net/softnic: add flow flush API > > > > Add rte flow flush api for flushing > > all the flows of the port. > > > > Signed-off-by: Reshma Pattan > > --- > > v3: Some style related changes > > v2: Use TAILQ_FOREACH_SAFE instead of TAILQ_FOREACH for safe removal > > using TAILQ_REMOVAL. > > --- > > drivers/net/softnic/rte_eth_softnic_flow.c | 47 > > +++++++++++++++++++++- > > 1 file changed, 46 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c > > b/drivers/net/softnic/rte_eth_softnic_flow.c > > index 03d41bc01..08ea6e940 100644 > > --- a/drivers/net/softnic/rte_eth_softnic_flow.c > > +++ b/drivers/net/softnic/rte_eth_softnic_flow.c > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "rte_eth_softnic_internals.h" > > #include "rte_eth_softnic.h" > > @@ -1915,6 +1916,50 @@ pmd_flow_destroy(struct rte_eth_dev *dev, > > return 0; > > } > > > > +static int > > +pmd_flow_flush(struct rte_eth_dev *dev, > > + struct rte_flow_error *error) > > +{ > > + struct pmd_internals *softnic =3D dev->data->dev_private; > > + struct pipeline *pipeline; > > + uint32_t i; > > + > > + TAILQ_FOREACH(pipeline, &softnic->pipeline_list, node) { > > + /* Remove all the flows added to the tables. */ > > + for (i =3D 0; i < pipeline->n_tables; i++) { > > + struct softnic_table *table =3D &pipeline->table[i]; > > + struct rte_flow *flow; > > + void *temp; > > + int status; > > + > > + TAILQ_FOREACH_SAFE(flow, &table->flows, node, > > temp) { > > + /* Rule delete. */ > > + status =3D softnic_pipeline_table_rule_delete > > + (softnic, > > + pipeline->name, > > + i, > > + &flow->match); > > + if (status) > > + return rte_flow_error_set(error, > > + EINVAL, > > + > > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > + NULL, > > + "Pipeline table rule delete > > failed"); >=20 > When rule deletion fails, you should not abort, but set up a flag and con= tinue > to delete the remaining rules. Done in v4. >=20 >=20 > > + > > + /* Update dependencies */ > > + if (is_meter_action_enable(softnic, table)) > > + flow_meter_owner_reset(softnic, > > flow); > > + > > + /* Flow delete. */ > > + TAILQ_REMOVE(&table->flows, flow, node); > > + free(flow); > > + } > > + } > > + } > > + >=20 > This is the place to examine the above mentioned flag and set the error > function argument. If error, the error message basically says "some of th= e > rules could not be deleted". >=20 Done in v4. Thanks, Reshma