patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>, stable@dpdk.org
Cc: bluca@debian.org, Christian Ehrhardt <christian.ehrhardt@canonical.com>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix buffer leakage on Tx queue release
Date: Mon, 19 Apr 2021 09:56:50 +0100	[thread overview]
Message-ID: <28f44936-21de-95aa-1ebc-a61fcaa496ef@redhat.com> (raw)
In-Reply-To: <20210417183808.5668-1-viacheslavo@nvidia.com>

Relevant for 19.11 and 20.11 LTS

+cc Christian (19.11 LTS maintainer)

On 17/04/2021 19:38, Viacheslav Ovsiienko wrote:
> On Tx queue release the mlx5 PMD freed the mbufs stored
> in the elts array (holds buffers being transmitted) only
> for zero reference counter. The one reference is hold
> for the queue release call. Hence, on device stop call
> the reference counter was at least 2 and elts array was
> not freed. If application called the device start without
> queue release the elts array was cleaned up and the
> remaining mbufs were lost.
> 
> Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> ---
> This patch is applicable for 19.11LTS only (and possible for
> preceeding releases), no bug in 20.11 and Upstream.
> 
>  drivers/net/mlx5/mlx5_txq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
> index 9c929a57ea..d9576e7a64 100644
> --- a/drivers/net/mlx5/mlx5_txq.c
> +++ b/drivers/net/mlx5/mlx5_txq.c
> @@ -1415,6 +1415,8 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
>  	txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
>  	if (txq->obj && !mlx5_txq_obj_release(txq->obj))
>  		txq->obj = NULL;
> +	if (rte_atomic32_read(&txq->refcnt <= 2)
> +		txq_free_elts(txq);
>  	if (rte_atomic32_dec_and_test(&txq->refcnt)) {
>  		txq_free_elts(txq);
>  		mlx5_mr_btree_free(&txq->txq.mr_ctrl.cache_bh);
> 


      reply	other threads:[~2021-04-19  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 18:38 Viacheslav Ovsiienko
2021-04-19  8:56 ` Kevin Traynor [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=28f44936-21de-95aa-1ebc-a61fcaa496ef@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=bluca@debian.org \
    --cc=christian.ehrhardt@canonical.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@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).