DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Matan Azrad <matan@nvidia.com>, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: fix configuration mutex cleanup
Date: Wed, 27 Jan 2021 11:45:27 +0100	[thread overview]
Message-ID: <17ff796f-a3d9-9b23-bb7f-c52ab9f935d6@redhat.com> (raw)
In-Reply-To: <1609915409-272126-1-git-send-email-matan@nvidia.com>



On 1/6/21 7:43 AM, Matan Azrad wrote:
> When the vDPA device is closed, the driver polling thread is canceled.
> The polling thread locks the configuration mutex while it polls the CQs.
> 
> When the cancellation happens, it may terminate the thread inside the
> critical section what remains the configuration mutex locked.
> 
> After device close, the driver may be configured again, in this case,
> for example, when the first queue state is updated, the driver tries to
> lock the mutex again and deadlock appears.
> 
> Initialize the mutex after the polling thread cancellation.
> 
> Fixes: 99abbd62c272 ("vdpa/mlx5: fix queue update synchronization")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Matan Azrad <matan@nvidia.com>
> Acked-by: Xueming Li <xuemingl@nvidia.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
> index b64f364..0b2f1ab 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
> @@ -295,6 +295,8 @@
>  	}
>  	priv->configured = 0;
>  	priv->vid = 0;
> +	/* The mutex may stay locked after event thread cancel - initiate it. */
> +	pthread_mutex_init(&priv->vq_config_lock, NULL);
>  	DRV_LOG(INFO, "vDPA device %d was closed.", vid);
>  	return ret;
>  }
> 

Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>


  parent reply	other threads:[~2021-01-27 10:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  6:43 Matan Azrad
2021-01-07 18:09 ` Maxime Coquelin
2021-01-08  8:48   ` [dpdk-dev] [dpdk-stable] " David Marchand
2021-01-14  8:34     ` David Marchand
2021-01-14 11:49       ` Matan Azrad
2021-01-14 12:38         ` Maxime Coquelin
2021-01-14 13:09           ` Matan Azrad
2021-01-14 14:27             ` Maxime Coquelin
2021-01-14 15:23               ` Matan Azrad
2021-01-21 10:46                 ` Maxime Coquelin
2021-01-21 20:13                   ` Matan Azrad
2021-01-26 10:22                     ` Maxime Coquelin
2021-01-26 10:45                       ` Matan Azrad
2021-01-26 13:00                         ` Maxime Coquelin
2021-01-26 18:23                           ` Matan Azrad
2021-01-27 10:45 ` Maxime Coquelin [this message]
2021-01-27 12:01 ` [dpdk-dev] " Maxime Coquelin

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=17ff796f-a3d9-9b23-bb7f-c52ab9f935d6@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    /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).