DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: "Yongseok Koh" <yskoh@mellanox.com>,
	"Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>,
	Wisam Monther <wisamm@mellanox.com>,
	Raslan Darawsheh <rasland@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix count query when flow has not counters
Date: Thu, 26 Jul 2018 05:39:18 +0000	[thread overview]
Message-ID: <DB7PR05MB4426ADF5F03EBE4C5916A615C32B0@DB7PR05MB4426.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <5078406F-E033-43EA-8FFF-0D53EA58DD57@mellanox.com>

Wednesday, July 25, 2018 8:25 PM, Yongseok Koh:
> Subject: Re: [PATCH] net/mlx5: fix count query when flow has not counters
> 
> 
> > On Jul 25, 2018, at 1:46 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> wrote:
> >
> > Querying a counters on a flow without counter is ending with a
> > segmentation fault.
> >
> > Fixes: 60bd8c9747e8 ("net/mlx5: add count flow action")
> >
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> > ---
> > drivers/net/mlx5/mlx5_flow.c | 56 ++++++++++++++++++++----------------
> > 1 file changed, 32 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.c
> > b/drivers/net/mlx5/mlx5_flow.c index 6fa4e30ae..efaa8b4fb 100644
> > --- a/drivers/net/mlx5/mlx5_flow.c
> > +++ b/drivers/net/mlx5/mlx5_flow.c
> > @@ -3192,32 +3192,40 @@ mlx5_flow_query_count(struct rte_flow *flow
> __rte_unused,
> > 		      struct rte_flow_error *error)
> > {
> > #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
> > -	struct rte_flow_query_count *qc = data;
> > -	uint64_t counters[2] = {0, 0};
> > -	struct ibv_query_counter_set_attr query_cs_attr = {
> > -		.cs = flow->counter->cs,
> > -		.query_flags = IBV_COUNTER_SET_FORCE_UPDATE,
> > -	};
> > -	struct ibv_counter_set_data query_out = {
> > -		.out = counters,
> > -		.outlen = 2 * sizeof(uint64_t),
> > -	};
> > -	int err = mlx5_glue->query_counter_set(&query_cs_attr,
> &query_out);
> > +	if (flow->modifier & MLX5_FLOW_MOD_COUNT) {
> 
> Instead of adding extra indentation, how about returning error immediately
> if the flow doesn't have a counter? That looks more natural. But even if you
> insist this way, I'm also okay. Please let Shahaf know if you will submit v2.
> 
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

I will take this one,

Applied to next-net-mlx, thanks. 

      reply	other threads:[~2018-07-26  5:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25  8:46 Nelio Laranjeiro
2018-07-25 12:55 ` Ori Kam
2018-07-25 17:25 ` Yongseok Koh
2018-07-26  5:39   ` Shahaf Shuler [this message]

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=DB7PR05MB4426ADF5F03EBE4C5916A615C32B0@DB7PR05MB4426.eurprd05.prod.outlook.com \
    --to=shahafs@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=orika@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=wisamm@mellanox.com \
    --cc=yskoh@mellanox.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).