On 04/27/2018 05:19 PM, xiangxia.m....@gmail.com wrote:
From: Tonghao Zhang <xiangxia.m....@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: sta...@dpdk.org
Cc: Yuanhan Liu <y...@fridaylinux.org>
Signed-off-by: Tonghao Zhang <xiangxia.m....@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

Reply via email to