From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 889099FE for ; Mon, 11 Dec 2017 16:51:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 07:51:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,392,1508828400"; d="scan'208";a="11409817" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2017 07:51:07 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by IRSMSX101.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Mon, 11 Dec 2017 15:51:07 +0000 From: "Singh, Jasvinder" To: "Iremonger, Bernard" , "dev@dpdk.org" Thread-Topic: [PATCH 1/3] lib/librte_flow_classify: remove table id parameter from apis Thread-Index: AQHTbR9IK2W2uZDIFEmGHmRTnsyQ3aM0liGAgAGspICACBEGgA== Date: Mon, 11 Dec 2017 15:51:06 +0000 Message-ID: <54CBAA185211B4429112C315DA58FF6D33298A19@IRSMSX103.ger.corp.intel.com> References: <20171123113215.64757-1-jasvinder.singh@intel.com> <8CEF83825BEC744B83065625E567D7C24E063F94@IRSMSX108.ger.corp.intel.com> <8CEF83825BEC744B83065625E567D7C24E064632@IRSMSX108.ger.corp.intel.com> <8CEF83825BEC744B83065625E567D7C24E064CB3@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C24E064CB3@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYThkMDg0NmUtMzI3Mi00NTE3LTk0YmMtMmNmYmQxNDVhYTFlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im1hc0JaU29qMmh1cEtHNDZUVjRWYUlQQkxLelg4bDEyemRxM0oyZnQyZk09In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/3] lib/librte_flow_classify: remove table id parameter from apis 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, 11 Dec 2017 15:51:10 -0000 > -----Original Message----- > From: Iremonger, Bernard > Sent: Wednesday, December 6, 2017 12:34 PM > To: Iremonger, Bernard ; Singh, Jasvinder > ; dev@dpdk.org > Subject: RE: [PATCH 1/3] lib/librte_flow_classify: remove table id parame= ter > from apis >=20 > Hi Jasvinder, >=20 > > > > -----Original Message----- > > > > From: Singh, Jasvinder > > > > Sent: Thursday, November 23, 2017 11:32 AM > > > > To: dev@dpdk.org > > > > Cc: Iremonger, Bernard > > > > Subject: [PATCH 1/3] lib/librte_flow_classify: remove table id > > > > parameter from apis > > > > > > > > This patch removes table id parameter from all the flow classify > > > > apis to reduce the complexity and and does some cleanup of the code= . > > > > > > > > The validate api has been exposed as public api to allows user to > > > > validate the flow before adding it to the classifier. > > > > > > > > The sample app and unit tests have been updated to accomodate the > > > > apis changes. > > > > > > > > Signed-off-by: Jasvinder Singh > > > > --- > > > > examples/flow_classify/flow_classify.c | 27 +- > > > > lib/librte_flow_classify/rte_flow_classify.c | 320 +++++++++= ++-------- > -- > > > > lib/librte_flow_classify/rte_flow_classify.h | 74 +++-- > > > > lib/librte_flow_classify/rte_flow_classify_parse.c | 118 ++++---- > > > > lib/librte_flow_classify/rte_flow_classify_parse.h | 16 +- > > > > .../rte_flow_classify_version.map | 1 + > > > > test/test/test_flow_classify.c | 86 +++--- > > > > test/test/test_flow_classify.h | 10 +- > > > > 8 files changed, 365 insertions(+), 287 deletions(-) > > > > >=20 > It would be better to break this patch into three patches, a > librte_flow_classify patch, a flow_classify sample app patch, and a > test_flow_classify patch. Ok, Will break this into multiple patches. > flow_classify test > > > > diff --git a/examples/flow_classify/flow_classify.c > > > > b/examples/flow_classify/flow_classify.c > > > > index 766f1dd..37e6904 100644 > > > > --- a/examples/flow_classify/flow_classify.c > > > > +++ b/examples/flow_classify/flow_classify.c > > > > + if (!actions) { > > > > + rte_flow_error_set(error, EINVAL, > > > > + RTE_FLOW_ERROR_TYPE_ACTION_NUM, > > > > + NULL, "NULL action."); > > > > + return -EINVAL; > > > > + } > > > > + > > > > + if (!error) { > > > > + rte_flow_error_set(error, EINVAL, > > > > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > > > + NULL, "NULL error."); > > > > + return -EINVAL; > > > > + } >=20 > The check on error, should be the first check and should not use > rte_flow_error_set(). Will correct this. > > > > + > > > > + memset(&cls->ntuple_filter, 0, sizeof(cls->ntuple_filter)); > > > > > > > > /* Get the non-void item number of pattern */ > > > > while ((pattern + i)->type !=3D RTE_FLOW_ITEM_TYPE_END) { @@ - > > > > 150,7 +195,7 @@ flow_classify_parse_flow( > > > > return -EINVAL; > > > > } > > > > > > > > struct rte_flow_classify_rule *rule; > > > > struct rte_flow_classify_table_entry *table_entry; > > > > + struct classify_action *action; > > > > + uint32_t i; > > > > int ret; > > > > > > > > - if (!error) > > > > - return NULL; > > > > - > > > > - if (!cls) { > > > > - rte_flow_error_set(error, EINVAL, > > > > - RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > > > - NULL, "NULL classifier."); > > > > - return NULL; > > > > - } > > > > - > > > > - if (table_id >=3D cls->num_tables) { > > > > - rte_flow_error_set(error, EINVAL, > > > > - RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > > > > - NULL, "invalid table_id."); > > > > - return NULL; > > > > - } > > > > - > > > > if (key_found =3D=3D NULL) { > > > > rte_flow_error_set(error, EINVAL, > > > > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, @@ > - > > 520,91 +536,95 @@ > > > > rte_flow_classify_table_entry_add(struct > > > > rte_flow_classifier *cls, > > > > return NULL; > > > > } > > > > >=20 > The check on error should be restored as the first check. Ok. =20 > > > > - if (!pattern) { > > > > - rte_flow_error_set(error, EINVAL, > > > > - RTE_FLOW_ERROR_TYPE_ITEM_NUM, > > > > - NULL, "NULL pattern."); > > > > - return NULL; > > > > - } > > > > - > > > > - if (!actions) { > > > > - rte_flow_error_set(error, EINVAL, > > > > - RTE_FLOW_ERROR_TYPE_ACTION_NUM, > > > > - NULL, "NULL action."); > > > > - return NULL; > > > > - } > > > > static struct rte_flow_action count_action_bad =3D { -1, 0}; > > > > > > > > static struct rte_flow_action end_action =3D { > > > > RTE_FLOW_ACTION_TYPE_END, 0}; > > > > -- > > > > 2.9.3 > > > > > > This patch fails to apply to the 18.02 master branch, a rebase may be > needed. > > > > > > Regards, > > > > > > Bernard. > > > > False alarm, the patch applies ok on a fresh checkout. > > > > Regards, > > > > Bernard. Thank you for the review, Bernard. Jasvinder