numam-spdk/lib/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
..
rte_vhost rte_vhost: fix deadlock on rte_vhost_driver_unregister() 2019-05-24 00:53:42 +00:00
Makefile vhost: install external msg handling hooks to rte_vhost 2019-03-13 14:26:20 +00:00
rte_vhost_compat.c vhost: introduce vsession->started 2019-05-10 22:31:41 +00:00
vhost_blk.c vhost: allocate device objects with regular calloc 2019-04-22 16:50:37 +00:00
vhost_internal.h vhost: introduce vsession->started 2019-05-10 22:31:41 +00:00
vhost_nvme.c vhost: allocate device objects with regular calloc 2019-04-22 16:50:37 +00:00
vhost_rpc.c configure: add option not to use the internal rte_vhost copy 2019-03-13 14:26:20 +00:00
vhost_scsi.c vhost: introduce vsession->started 2019-05-10 22:31:41 +00:00
vhost.c vhost: remove 2MB memory region size restriction 2019-05-22 00:53:08 +00:00