Spdk/lib/vhost
Changpeng Liu 1f9c7a74bc vhost: stop started session in session_shutdown
DPDK vhost will call `new_device` when the VRINGs are
queue paired(virtio-net) or all the VRINGs are started.
However, for virtio-blk/scsi, SeaBIOS will only use one
VRING queue, DPDK added a workaround patch to add
`pre_msg_handle` and `post_msg_handle` callbacks to let
devices other than virtio-net to process such scenarios.

In SPDK, we will start the device when there is one valid
VRING, so there is a case that SPDK and DPDK have different
state for one device.  For a virtio-scsi device, SeaBIOS will
only start the request queue, and in the BIOS stage, SPDK will
start the device but DPDK doesn't think so.  If users killed
SPDK vhost target at the moment, in `session_shutdown`, SPDK
will expect DPDK to call `destroy_device` to do the cleanup,
but DPDK won't do that as it thinks the device isn't started.

Here in `session_shutdown`, SPDK will do this first, it's OK
that DPDK will call another `destroy_device` for devices that
have the same state both in SPDK and DPDK.

Fix issue #2228.

Change-Id: Ib76dd54c8fa302ffe6da9b13498312b7d344bbfe
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10143
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-11-11 23:23:06 +00:00
..
Makefile so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
rte_vhost_compat.c lib:vhost Add version check when use RTE_VHOST_USER_ASYNC_COPY in 21.01 2021-02-11 08:40:31 +00:00
spdk_vhost.map lib/vhost: Remove and inline spdk_vhost_blk_get_dev 2020-06-08 09:28:27 +00:00
vhost_blk.c vhost-blk: fix interrupt names 2021-09-02 07:43:37 +00:00
vhost_internal.h vhost-blk: add set interrupt mode to poller 2021-04-23 18:09:54 +00:00
vhost_rpc.c vhost-blk: recover ring base when reconnect 2021-01-15 08:30:18 +00:00
vhost_scsi.c vhost_scsi: fix a heap-use-after-free case 2021-11-11 23:23:06 +00:00
vhost.c vhost: stop started session in session_shutdown 2021-11-11 23:23:06 +00:00