Spdk/lib/vhost/rte_vhost
Tianyu yang 151a357ca3 rte_vhost: fix deadlock on rte_vhost_driver_unregister()
when qemu connect to vhost, but don't send msg to vhost. We use
kill -15 to destroy vhost process. it will lead to deadlock.
(A)
* rte_vhost_driver_unregister()
 * pthread_mutex_lock hold vhost_user.mutex (1)
 * wait TAILQ_FIRST(&vsocket->conn_list) is NULL
(B)
* fdset_event_dispatch()
 * vhost_user_read_cb() start
   * vhost_user_msg_handler() start
   * dev->notify_ops is NULL because qemu just connect, no message recv.
   * vhost_driver_callback_get()
     * pthread_mutex_lock hold vhost_user.mutex (2)

(A) & (B) deadlock

To avoid this scenes, when qemu connect in vhost_new_device()
initialize dev->notify_ops

Change-Id: Iaf699da41dfa3088cfc0f09688b50fada6b2c8d6
Signed-off-by: Tianyu yang <yangtianyu2@huawei.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454832
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-24 00:53:42 +00:00
..
fd_man.c vhost: upgrade SPDK vhost code to DPDK 17.05 2017-05-08 17:04:29 -07:00
fd_man.h vhost: upgrade SPDK vhost code to DPDK 17.05 2017-05-08 17:04:29 -07:00
Makefile rte_vhost: include rte_config.h via compiler option 2017-09-07 18:02:09 -04:00
rte_vhost.h rte_vhost: introduce get/set vring base idx APIs 2019-02-27 01:43:16 +00:00
socket.c rte_vhost: fix deadlock on rte_vhost_driver_unregister() 2019-05-24 00:53:42 +00:00
vhost_user.c rte_vhost: fix deadlock on rte_vhost_driver_unregister() 2019-05-24 00:53:42 +00:00
vhost_user.h vhost/nvme: remove VHOST_USER_NVME_IO_CMD socket message 2018-11-27 13:24:42 +00:00
vhost.c rte_vhost: fix deadlock on rte_vhost_driver_unregister() 2019-05-24 00:53:42 +00:00
vhost.h rte_vhost: fix deadlock on rte_vhost_driver_unregister() 2019-05-24 00:53:42 +00:00