From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nelio Laranjeiro Subject: Re: [RFC 2/4] app/testpmd: support rte_flow rss level parsing Date: Thu, 30 Nov 2017 11:13:35 +0100 Message-ID: <20171130101335.mau3tykqrfn535ix@laranjeiro-vm.dev.6wind.com> References: <20171129173106.120828-1-xuemingl@mellanox.com> <20171129173106.120828-3-xuemingl@mellanox.com> <20171130081828.acwftejwwlbuybsd@laranjeiro-vm.dev.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Adrien Mazarguil , Thomas Monjalon , "dev@dpdk.org" To: "Xueming(Steven) Li" Return-path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 0153C2A62 for ; Thu, 30 Nov 2017 11:13:33 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id i11so11307041wmf.4 for ; Thu, 30 Nov 2017 02:13:33 -0800 (PST) Content-Disposition: inline In-Reply-To: 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 Thu, Nov 30, 2017 at 08:50:13AM +0000, Xueming(Steven) Li wrote: > > > > -----Original Message----- > > From: Nelio Laranjeiro [mailto:nelio.laranjeiro@6wind.com] > > Sent: Thursday, November 30, 2017 4:18 PM > > To: Xueming(Steven) Li > > Cc: Adrien Mazarguil ; Thomas Monjalon > > ; dev@dpdk.org > > Subject: Re: [RFC 2/4] app/testpmd: support rte_flow rss level parsing > > > > Hi Xueming, > > > > On Thu, Nov 30, 2017 at 01:31:04AM +0800, Xueming Li wrote: > > > Signed-off-by: Xueming Li > > > --- > > > app/test-pmd/cmdline_flow.c | 14 +++++++++++++- > > > 1 file changed, 13 insertions(+), 1 deletion(-) > > > > > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > > > index df16d2a..9402eb7 100644 > > > --- a/app/test-pmd/cmdline_flow.c > > > +++ b/app/test-pmd/cmdline_flow.c > > > @@ -194,6 +194,7 @@ enum index { > > > ACTION_RSS, > > > ACTION_RSS_QUEUES, > > > ACTION_RSS_QUEUE, > > > + ACTION_RSS_LEVEL, > > > ACTION_PF, > > > ACTION_VF, > > > ACTION_VF_ORIGINAL, > > > @@ -640,6 +641,7 @@ struct parse_action_priv { > > > > > > static const enum index action_rss[] = { > > > ACTION_RSS_QUEUES, > > > + ACTION_RSS_LEVEL, > > > ACTION_NEXT, > > > ZERO, > > > }; > > > @@ -1586,6 +1588,13 @@ static int comp_vc_action_rss_queue(struct > > context *, const struct token *, > > > .call = parse_vc_action_rss_queue, > > > .comp = comp_vc_action_rss_queue, > > > }, > > > + [ACTION_RSS_LEVEL] = { > > > + .name = "level", > > > + .help = "rss on tunnel level", > > > + .next = NEXT(action_rss, NEXT_ENTRY(UNSIGNED)), > > > + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_rss, level)), > > > + .call = parse_vc_conf, > > > + }, > > > [ACTION_PF] = { > > > .name = "pf", > > > .help = "redirect packets to physical device function", @@ - > > 1887,6 > > > +1896,7 @@ static int comp_vc_action_rss_queue(struct context *, const > > struct token *, > > > sizeof(double)); > > > if ((uint8_t *)item + sizeof(*item) > data) > > > return -1; > > > + memset(data, 0, data_size); > > > *item = (struct rte_flow_item){ > > > .type = priv->type, > > > }; > > > @@ -1904,6 +1914,9 @@ static int comp_vc_action_rss_queue(struct context > > *, const struct token *, > > > sizeof(double)); > > > if ((uint8_t *)action + sizeof(*action) > data) > > > return -1; > > > + memset(data, 0, data_size); > > > + if (priv->type == RTE_FLOW_ACTION_TYPE_RSS) > > > + ((struct rte_flow_action_rss *)data)->level = -1; > > > > I strongly suggest to let the level set to outer, otherwise most of the > > PMD will have to refuse such rule. > Default to outer rss? Would be glad to hear more suggestion on this. The point is, not a single NIC will react the same way with testpmd with such value as default. NIC with RSS inner capability will start spreading tunnel packets differently than the other who don't have it. Default value should be set to have the same default on all NIC. > > > *action = (struct rte_flow_action){ > > > .type = priv->type, > > > }; > > > @@ -1911,7 +1924,6 @@ static int comp_vc_action_rss_queue(struct context > > *, const struct token *, > > > ctx->object = action; > > > ctx->objmask = NULL; > > > } > > > - memset(data, 0, data_size); > > > out->args.vc.data = data; > > > ctx->objdata = data_size; > > > return len; > > > -- > > > 1.8.3.1 -- Nélio Laranjeiro 6WIND