From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: "Iremonger, Bernard" <bernard.iremonger@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/3] lib/librte_flow_classify: remove table id parameter from apis
Date: Mon, 11 Dec 2017 15:51:06 +0000 [thread overview]
Message-ID: <54CBAA185211B4429112C315DA58FF6D33298A19@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <8CEF83825BEC744B83065625E567D7C24E064CB3@IRSMSX108.ger.corp.intel.com>
> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Wednesday, December 6, 2017 12:34 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>; dev@dpdk.org
> Subject: RE: [PATCH 1/3] lib/librte_flow_classify: remove table id parameter
> from apis
>
> Hi Jasvinder,
>
> > > > -----Original Message-----
> > > > From: Singh, Jasvinder
> > > > Sent: Thursday, November 23, 2017 11:32 AM
> > > > To: dev@dpdk.org
> > > > Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> > > > 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 <jasvinder.singh@intel.com>
> > > > ---
> > > > 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(-)
> > > >
>
> 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
<snip>
> > > > + 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;
> > > > + }
>
> 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 != RTE_FLOW_ITEM_TYPE_END) { @@ -
> > > > 150,7 +195,7 @@ flow_classify_parse_flow(
> > > > return -EINVAL;
> > > > }
> > > >
<snip>
> > > > 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 >= cls->num_tables) {
> > > > - rte_flow_error_set(error, EINVAL,
> > > > - RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> > > > - NULL, "invalid table_id.");
> > > > - return NULL;
> > > > - }
> > > > -
> > > > if (key_found == 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;
> > > > }
> > > >
>
> The check on error should be restored as the first check.
Ok.
> > > > - 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;
> > > > - }
<snip>
> > > > static struct rte_flow_action count_action_bad = { -1, 0};
> > > >
> > > > static struct rte_flow_action end_action = {
> > > > 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
next prev parent reply other threads:[~2017-12-11 15:51 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 11:32 Jasvinder Singh
2017-11-23 11:32 ` [dpdk-dev] [PATCH 2/3] lib/librte_flow_classy: add run api for flow classification Jasvinder Singh
2017-12-04 16:46 ` Iremonger, Bernard
2017-12-05 11:01 ` Iremonger, Bernard
2017-12-06 12:41 ` Iremonger, Bernard
2017-12-11 15:52 ` Singh, Jasvinder
2017-11-23 11:32 ` [dpdk-dev] [PATCH 3/3] doc: update documentation for flow classify lib Jasvinder Singh
2017-12-06 12:04 ` Iremonger, Bernard
2017-12-11 14:54 ` Mcnamara, John
2017-12-11 15:53 ` Singh, Jasvinder
2017-12-04 16:45 ` [dpdk-dev] [PATCH 1/3] lib/librte_flow_classify: remove table id parameter from apis Iremonger, Bernard
2017-12-05 10:59 ` Iremonger, Bernard
2017-12-06 12:34 ` Iremonger, Bernard
2017-12-11 15:51 ` Singh, Jasvinder [this message]
2017-12-11 16:26 ` [dpdk-dev] [PATCH v2 1/4] " Jasvinder Singh
2017-12-11 16:26 ` [dpdk-dev] [PATCH v2 2/4] test/test_flow_classify: update test to accomodate changes Jasvinder Singh
2017-12-11 16:26 ` [dpdk-dev] [PATCH v2 3/4] examples/flow_classify: update sample application Jasvinder Singh
2017-12-14 14:42 ` Iremonger, Bernard
2017-12-11 16:26 ` [dpdk-dev] [PATCH v2 4/4] doc: update documentation for flow classify lib Jasvinder Singh
2017-12-14 14:49 ` Iremonger, Bernard
2017-12-15 10:39 ` [dpdk-dev] [PATCH v3 1/4] lib/librte_flow_classify: remove table id parameter from apis Jasvinder Singh
2017-12-15 10:39 ` [dpdk-dev] [PATCH v3 2/4] test/test_flow_classify: update test to accommodate changes Jasvinder Singh
2017-12-19 12:06 ` Iremonger, Bernard
2017-12-15 10:39 ` [dpdk-dev] [PATCH v3 3/4] examples/flow_classify: update sample application Jasvinder Singh
2017-12-19 12:09 ` Iremonger, Bernard
2017-12-15 10:39 ` [dpdk-dev] [PATCH v3 4/4] doc: update documentation for flow classify lib Jasvinder Singh
2017-12-18 11:04 ` Kovacevic, Marko
2017-12-18 13:40 ` Singh, Jasvinder
2017-12-19 12:13 ` Iremonger, Bernard
2017-12-19 12:03 ` [dpdk-dev] [PATCH v3 1/4] lib/librte_flow_classify: remove table id parameter from apis Iremonger, Bernard
2017-12-19 14:29 ` [dpdk-dev] [PATCH v4 " Jasvinder Singh
2017-12-19 14:29 ` [dpdk-dev] [PATCH v4 2/4] test/test_flow_classify: update test to accommodate changes Jasvinder Singh
2017-12-19 14:29 ` [dpdk-dev] [PATCH v4 3/4] examples/flow_classify: update sample application Jasvinder Singh
2017-12-19 14:29 ` [dpdk-dev] [PATCH v4 4/4] doc: update documentation for flow classify lib Jasvinder Singh
2018-01-10 0:19 ` [dpdk-dev] [PATCH v4 1/4] lib/librte_flow_classify: remove table id parameter from apis Thomas Monjalon
2018-01-10 9:54 ` Singh, Jasvinder
2018-01-10 10:52 ` Thomas Monjalon
2018-01-10 10:59 ` Singh, Jasvinder
2018-01-10 11:07 ` Thomas Monjalon
2018-01-10 11:12 ` Singh, Jasvinder
2018-01-11 18:20 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54CBAA185211B4429112C315DA58FF6D33298A19@IRSMSX103.ger.corp.intel.com \
--to=jasvinder.singh@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).