All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: xiangxia.m.yue@gmail.com, jianfeng.tan@intel.com, yliu@fridaylinux.org
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH 1/3] vhost: fix deadlock due to vhostuser socket and fdset
Date: Fri, 4 May 2018 17:11:29 +0200	[thread overview]
Message-ID: <acaaff29-8f1a-9885-f305-7e175bb89d83@redhat.com> (raw)
In-Reply-To: <1524842385-61707-1-git-send-email-xiangxia.m.yue@gmail.com>



On 04/27/2018 05:19 PM, xiangxia.m.yue@gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> When qemu close the unix socket fd of the vhostuser as a
> server, and then immediately delete the vhostuser port on
> openvswitch. There will be a deadlock.
> 
> A thread (fdset event thread):       B thread:
> 1. fdset_event_dispatch              rte_vhost_driver_unregister
> 2. set the fd busy to 1.             lock vsocket->conn_mutex
> 3. vhost_user_read_cb                fdset_del waits busy changed to 0.
> 4. vhost peer closed, remove the
>     conn from vsocket->conn_list:
>     lock vsocket->conn_mutex
> 
> 5. set the fd busy to 0
> 
> Fixes: 65388b43 ("vhost: fix fd leaks for vhost-user server mode")
> Cc: stable@dpdk.org
> Cc: Yuanhan Liu <yliu@fridaylinux.org>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
>   lib/librte_vhost/fd_man.c | 32 ++++++++++++++++++++++++++++++++
>   lib/librte_vhost/fd_man.h |  1 +
>   lib/librte_vhost/socket.c | 13 ++++++++++++-
>   3 files changed, 45 insertions(+), 1 deletion(-)
> 

Applied to dpdk-next-virtio/master.

Please next time add a cover-letter and run check-git-log.sh and
checkpatch.sh scripts before submitting.

Thanks!
Maxime

      parent reply	other threads:[~2018-05-04 15:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 15:19 [PATCH 1/3] vhost: fix deadlock due to vhostuser socket and fdset xiangxia.m.yue
2018-04-27 15:19 ` [PATCH 2/3] vhost: fix crash and fd leak due to vhostuser destroyed xiangxia.m.yue
2018-05-04 13:02   ` Maxime Coquelin
2018-05-04 15:11   ` Maxime Coquelin
2018-04-27 15:19 ` [PATCH 3/3] vhost: fix typo in fdset_event_dispatch comment xiangxia.m.yue
2018-05-04 13:03   ` Maxime Coquelin
2018-05-04 15:11   ` Maxime Coquelin
2018-05-04 13:00 ` [PATCH 1/3] vhost: fix deadlock due to vhostuser socket and fdset Maxime Coquelin
2018-05-04 15:11 ` Maxime Coquelin [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=acaaff29-8f1a-9885-f305-7e175bb89d83@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiangxia.m.yue@gmail.com \
    --cc=yliu@fridaylinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.