From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH 3/7] app/testpmd: add GTP fields to flow command Date: Wed, 6 Sep 2017 18:03:19 +0200 Message-ID: <20170906160319.GC4301@6wind.com> References: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> <1503647430-93905-4-git-send-email-beilei.xing@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jingjing.wu@intel.com, dev@dpdk.org To: Beilei Xing Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id A21157CC6 for ; Wed, 6 Sep 2017 18:03:30 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id u26so32865843wma.0 for ; Wed, 06 Sep 2017 09:03:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1503647430-93905-4-git-send-email-beilei.xing@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 Fri, Aug 25, 2017 at 03:50:26PM +0800, Beilei Xing wrote: > This patch exposes the following item fields through the flow command: > > - GTP TEID > > Signed-off-by: Beilei Xing Minor nits, see below. > --- > app/test-pmd/cmdline_flow.c | 22 ++++++++++++++++++++++ > app/test-pmd/config.c | 1 + > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++++ > 3 files changed, 27 insertions(+) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index a17a004..4ab5bcc 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -171,6 +171,8 @@ enum index { > ITEM_GRE_PROTO, > ITEM_FUZZY, > ITEM_FUZZY_THRESH, > + ITEM_GTP, > + ITEM_GTP_TEID, > > /* Validate/create actions. */ > ACTIONS, > @@ -451,6 +453,7 @@ static const enum index next_item[] = { > ITEM_MPLS, > ITEM_GRE, > ITEM_FUZZY, > + ITEM_GTP, > ZERO, > }; > > @@ -588,6 +591,12 @@ static const enum index item_gre[] = { > ZERO, > }; > > +static const enum index item_gtp[] = { > + ITEM_GTP_TEID, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] = { > ACTION_END, > ACTION_VOID, > @@ -1421,6 +1430,19 @@ static const struct token token_list[] = { > .args = ARGS(ARGS_ENTRY(struct rte_flow_item_fuzzy, > thresh)), > }, > + [ITEM_GTP] = { > + .name = "gtp", > + .help = "match GTP header", > + .priv = PRIV_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), > + .next = NEXT(item_gtp), > + .call = parse_vc, > + }, > + [ITEM_GTP_TEID] = { > + .name = "teid", > + .help = "GTP TEID", No need to repeat "GTP". You may also expand the TEID acronym. > + .next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED), item_param), > + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp, teid)), > + }, > > /* Validate/create actions. */ > [ACTIONS] = { > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index 3ae3e1c..1f320a0 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -947,6 +947,7 @@ static const struct { > MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), > MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)), > MK_FLOW_ITEM(FUZZY, sizeof(struct rte_flow_item_fuzzy)), > + MK_FLOW_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), > }; > > /** Compute storage space needed by item specification. */ > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 2ed62f5..6ec463e 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -2696,6 +2696,10 @@ This section lists supported pattern items and their attributes, if any. > > - ``thresh {unsigned}``: accuracy threshold. > > +- ``gtp``: match GTP header. > + > + - ``teid {unsigned}``: GTP TEID. > + Same comment here. Indentation is also wrong. Thanks. -- Adrien Mazarguil 6WIND