From: Ori Kam <orika@mellanox.com>
To: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Cc: "adrien.mazaruil@6wind.com" <adrien.mazaruil@6wind.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC] net/mlx5: support count flow action
Date: Thu, 24 Aug 2017 14:04:32 +0000 [thread overview]
Message-ID: <AM4PR05MB3202536A61936AC4B8503EFCDB9A0@AM4PR05MB3202.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20170824065419.GH12995@autoinstall.dev.6wind.com>
Hi Nelio,
Please see my comments in line.
Ori
> -----Original Message-----
> From: Nélio Laranjeiro [mailto:nelio.laranjeiro@6wind.com]
> Sent: Thursday, August 24, 2017 9:54 AM
> To: Ori Kam <orika@mellanox.com>
> Cc: adrien.mazaruil@6wind.com; dev@dpdk.org
> Subject: Re: [RFC] net/mlx5: support count flow action
>
> Hi Ori,
>
> Please keep the coding style of the file, and pass checkpatch before
> submitting a patch on the mailing list. It helps the review by having a correct
> patch respecting the coding style of the file.
> I won't spot out here all the coding style issues, if you need some help, feel
> free to ask.
>
Sorry won't happen again.
> On Mon, Aug 21, 2017 at 03:35:41PM +0300, Ori Kam wrote:
> > Support count flow action.
>
> Why copy/pasting the title in the commit message?
>
I was under the impression that main function of the RFC should also be in the message body.
> > This patch is basic design only, do to missing features on the verbs
> > driver. As soon as the features will be implemented on the verbs
> > driver this will be updated and rebased on top of
> > dpdk.org/ml/archives/dev/2017-August/072351.html
> > (The verbs driver should be ready starting September)
> >
> > This RFC should be applied on top of
> > dpdk.org/ml/archives/dev/2017-August/072351.html
>
> Last two comments should be after '---' line.
>
Those two lines are part of the commit message, any way I will move them.
> > Signed-off-by: Ori Kam <orika@mellanox.com>
> > ---
> > drivers/net/mlx5/mlx5.h | 4 ++
> > drivers/net/mlx5/mlx5_flow.c | 163
> > ++++++++++++++++++++++++++++++++++++++++++-
>
> There are missing changes in the Makefile to have the
> HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_COUNT and the include of the
> mlx5_autoconf.h in mlx5_flow.c.
>
I haven't added them since this feature is not supported yet, and
I don't want anybody trying to activate them.
When the feature will be supported on the verbs then I will update
those files.
> > 2 files changed, 166 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index
> > e89aba8..434e848 100644
> > --- a/drivers/net/mlx5/mlx5.h
> > +++ b/drivers/net/mlx5/mlx5.h
> >[...]
> > +/**
> > + * Query an existing flow rule.
> > + *
> > + * @see rte_flow_query()
> > + * @see rte_flow_ops
> > + */
> > +int
> > +mlx5_flow_query(struct rte_eth_dev *dev,
> > + struct rte_flow *flow,
> > + enum rte_flow_action_type type,
> > + void *res,
> > + struct rte_flow_error *error)
> > +{
> > +
> > + int res_value = 0;
> > + switch (type){
> > + case RTE_FLOW_ACTION_TYPE_COUNT:
> > + if (!flow->counter) {
> > + rte_flow_error_set(error, EINVAL,
> > +
> RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> > + NULL,
> > + "No counter
> is set for this flow");
> > + return -1;
>
> Wrong returned value, read the rte_flow_query API allowed values.
>
Will be fixed
> > + }
> > +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_COUNT
> > + res_value =
> priv_flow_query_counter(mlx5_get_priv(dev), flow->counter,
> > + (struct rte_flow_query_count*)res,
> > + error);
> > +#else
> > + rte_flow_error_set(error, ENOTSUP,
> RTE_FLOW_ERROR_TYPE_ACTION,
> > + NULL,
> "Flow count unsupported");
> > + (void)dev;
> > + (void)flow;
> > + (void)type;
> > + (void)res;
> > + (void)error;
> > + return -1;
>
> Same here.
>
Will be fixed.
> > +#endif
>
> I'll suggest to have a dedicated function here to handle this situation, like a
> mlx5_flow_query_counters() and call it from this case. It will clearly ease the
> readability and maintenance.
>
Will be update according to your suggestion.
> Thanks,
>
> --
> Nélio Laranjeiro
> 6WIND
Thanks,
Ori Kam
next prev parent reply other threads:[~2017-08-24 14:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-21 12:35 Ori Kam
2017-08-24 6:54 ` Nélio Laranjeiro
2017-08-24 14:04 ` Ori Kam [this message]
2017-08-24 15:08 ` Nélio Laranjeiro
2017-10-10 14:22 ` [dpdk-dev] [PATCH v2] net/mlx5: flow counter support Nelio Laranjeiro
2017-10-10 16:10 ` Yongseok Koh
2017-10-11 1:32 ` Ferruh Yigit
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=AM4PR05MB3202536A61936AC4B8503EFCDB9A0@AM4PR05MB3202.eurprd05.prod.outlook.com \
--to=orika@mellanox.com \
--cc=adrien.mazaruil@6wind.com \
--cc=dev@dpdk.org \
--cc=nelio.laranjeiro@6wind.com \
/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).