patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: dpdk stable <stable@dpdk.org>, Xueming Li <xuemingl@nvidia.com>,
	 Raslan Darawsheh <rasland@nvidia.com>,
	matan@nvidia.com, Ali Alnubani <alialnu@nvidia.com>,
	 Michael Baum <michaelba@nvidia.com>,
	Dekel Peled <dekelp@nvidia.com>
Subject: Re: [dpdk-stable] [PATC 19.11] net/mlx5: fix flow split combined with counter
Date: Mon, 5 Jul 2021 13:17:44 +0200	[thread overview]
Message-ID: <CAATJJ0JgW1uAhwJqruqnaMuJxbijZ4kHc78DcsYDRaQUq9GAxQ@mail.gmail.com> (raw)
In-Reply-To: <20210705085856.13971-1-viacheslavo@nvidia.com>

On Mon, Jul 5, 2021 at 10:59 AM Viacheslav Ovsiienko
<viacheslavo@nvidia.com> wrote:
>
> From: Dekel Peled <dekelp@nvidia.com>
>
> [ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ]

Thanks, applied

> Currently, for a flow containing a count action, if flow is split to
> sub-flows, a new counter will be created for each sub-flow.
> However only the counter created for the last sub-flow will be queried
> on flow query and cleared on flow removal.
>
> This behavior is wrong, causing a leak of resources.
> Need to create just one counter per flow, and use it for all sub-flows.
>
> This patch adds the required check to make sure a counter is
> created just once per flow, and used by all sub-flows.
>
> Fixes: fa2d01c87d2b ("net/mlx5: support flow aging")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> index cea45a6d96..42ae1bbe2c 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -7377,12 +7377,13 @@ __flow_dv_translate(struct rte_eth_dev *dev,
>                                 rte_errno = ENOTSUP;
>                                 goto cnt_err;
>                         }
> -                       flow->counter = flow_dv_counter_alloc(dev,
> -                                                             count->shared,
> -                                                             count->id,
> -                                                             dev_flow->group);
> -                       if (flow->counter == NULL)
> -                               goto cnt_err;
> +                       if (!flow->counter) {
> +                               flow->counter = flow_dv_counter_alloc
> +                                               (dev, count->shared,
> +                                                count->id, dev_flow->group);
> +                               if (flow->counter == NULL)
> +                                       goto cnt_err;
> +                       }
>                         dev_flow->dv.actions[actions_n++] =
>                                 flow->counter->action;
>                         action_flags |= MLX5_FLOW_ACTION_COUNT;
> --
> 2.18.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

      reply	other threads:[~2021-07-05 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05  8:58 Viacheslav Ovsiienko
2021-07-05 11:17 ` Christian Ehrhardt [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=CAATJJ0JgW1uAhwJqruqnaMuJxbijZ4kHc78DcsYDRaQUq9GAxQ@mail.gmail.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=alialnu@nvidia.com \
    --cc=dekelp@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=michaelba@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=xuemingl@nvidia.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).