From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v4 5/6] testpmd: add support for MARK flow item Date: Thu, 19 Apr 2018 15:03:40 +0200 Message-ID: <20180419130340.GC4957@6wind.com> References: <1523017443-12414-1-git-send-email-declan.doherty@intel.com> <20180418210423.13847-1-declan.doherty@intel.com> <20180418210423.13847-6-declan.doherty@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Alex Rosenbaum , Ferruh Yigit , Thomas Monjalon , Shahaf Shuler , Qi Zhang , Alejandro Lucero , Andrew Rybchenko , Mohammad Abdul Awal , Remy Horton , John McNamara , Rony Efraim , Jingjing Wu , Wenzhuo Lu , Vincent Jardin , Yuanhan Liu , Bruce Richardson , Konstantin Ananyev , Zhihong Wang To: Declan Doherty Return-path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 11CCE1B170 for ; Thu, 19 Apr 2018 15:03:55 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id v60-v6so13835514wrc.7 for ; Thu, 19 Apr 2018 06:03:55 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180418210423.13847-6-declan.doherty@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Apr 18, 2018 at 10:04:22PM +0100, Declan Doherty wrote: > Add support for specificaiton of new MARK flow item in testpmd's cli, > and update testpmd documentation to describe new MARK flow item support. > > Signed-off-by: Declan Doherty specificaiton => specification, however you should merge this in the previous patch ("ethdev: add mark flow item to flow item types"), a few nits below. > --- > app/test-pmd/cmdline_flow.c | 22 ++++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++++ > 2 files changed, 26 insertions(+) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 93e9a240d..e6284ce11 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -87,6 +87,8 @@ enum index { > ITEM_VF_ID, > ITEM_PORT, > ITEM_PORT_INDEX, > + ITEM_MARK, > + ITEM_MARK_ID, > ITEM_RAW, > ITEM_RAW_RELATIVE, > ITEM_RAW_SEARCH, > @@ -419,6 +421,7 @@ static const enum index next_item[] = { > ITEM_PF, > ITEM_VF, > ITEM_PORT, > + ITEM_MARK, > ITEM_RAW, > ITEM_ETH, > ITEM_VLAN, > @@ -465,6 +468,12 @@ static const enum index item_port[] = { > ZERO, > }; > > +static const enum index item_mark[] = { > + ITEM_MARK_ID, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index item_raw[] = { > ITEM_RAW_RELATIVE, > ITEM_RAW_SEARCH, > @@ -1041,6 +1050,19 @@ static const struct token token_list[] = { > .next = NEXT(item_port, NEXT_ENTRY(UNSIGNED), item_param), > .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port, index)), > }, > + [ITEM_MARK] = { > + .name = "mark", > + .help = "match packets against value set in previous group", As previously discussed, you should drop the "previous group" part. > + .priv = PRIV_ITEM(MARK, sizeof(struct rte_flow_item_mark)), > + .next = NEXT(item_mark), > + .call = parse_vc, > + }, > + [ITEM_MARK_ID] = { > + .name = "id", > + .help = "Integer value to match against", > + .next = NEXT(item_mark, NEXT_ENTRY(UNSIGNED), item_param), > + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_mark, id)), > + }, > [ITEM_RAW] = { > .name = "raw", > .help = "match an arbitrary byte string", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 7ecd602da..2b5ade4a8 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3211,6 +3211,10 @@ This section lists supported pattern items and their attributes, if any. > > - ``index {unsigned}``: physical port index. > > +- ``mark``: match value set in previously matched flow in higher priority group. > + > + - ``id {unsigned}``: arbitrary integer value. > + Ditto. > - ``raw``: match an arbitrary byte string. > > - ``relative {boolean}``: look for pattern after the previous item. > -- > 2.14.3 > -- Adrien Mazarguil 6WIND