3318278a | 07-Dec-2024 |
Haoqian He <haoqian.he@smartx.com> |
vhost: check if vsession exists before remove scsi vdev
Before remove the vhost scsi target when deleting controller, we can return EBUSY if still exist vsession, which means the inflight IO has not
vhost: check if vsession exists before remove scsi vdev
Before remove the vhost scsi target when deleting controller, we can return EBUSY if still exist vsession, which means the inflight IO has not finished yet. Otherwise the guest may get I/O error.
Change-Id: Ib76b276efe1e9c6fa324bedc3cb5d9d4622c753f Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25517 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com> Reviewed-by: Changpeng Liu <changpeliu@tencent.com> Reviewed-by: Jim Harris <jim.harris@nvidia.com>
show more ...
|
f549a995 | 15-Nov-2024 |
Changpeng Liu <changpeliu@tencent.com> |
vhost_blk: return VIRTIO_BLK_S_UNSUPP for flush command
SPDK vhost-blk doesn't negociate `VIRTIO_BLK_F_FLUSH` nor `VIRTIO_BLK_F_CONFIG_WCE` feature bits, but we can still receive FLUSH commands from
vhost_blk: return VIRTIO_BLK_S_UNSUPP for flush command
SPDK vhost-blk doesn't negociate `VIRTIO_BLK_F_FLUSH` nor `VIRTIO_BLK_F_CONFIG_WCE` feature bits, but we can still receive FLUSH commands from VM, here we return correct errno for these commands in case the backend block device doesn't support it.
Partly fix issue #3572.
Change-Id: Ib6269818ae94b38bebed3603fa8b87e97d7e7ab1 Signed-off-by: Changpeng Liu <changpeliu@tencent.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25435 Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com> Reviewed-by: Jim Harris <jim.harris@nvidia.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: GangCao <gang.cao@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
06bc8ce5 | 04-Nov-2024 |
Changpeng Liu <changpeliu@tencent.com> |
lib/vhost: use RB_TREE for vhost device management
This is helpful when creating and starting many vhost devices at the same time, there are lots of lookups when starting a vhost device.
Change-Id:
lib/vhost: use RB_TREE for vhost device management
This is helpful when creating and starting many vhost devices at the same time, there are lots of lookups when starting a vhost device.
Change-Id: I3d395c569b6bab1c2c5c2f42d846dcf6f7d133f3 Signed-off-by: Changpeng Liu <changpeliu@tencent.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25402 Reviewed-by: GangCao <gang.cao@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Community-CI: Mellanox Build Bot
show more ...
|
b21c834a | 13-Aug-2024 |
Jim Harris <jim.harris@samsung.com> |
Revert "vhost-blk: enable multiple threads poll group support"
Fixes issue #3416. Fixes issue #3439.
This reverts commit 1c05f3fb0a66c37da57a87de53e6bbb551ee51f7. Signed-off-by: Jim Harris <jim.har
Revert "vhost-blk: enable multiple threads poll group support"
Fixes issue #3416. Fixes issue #3439.
This reverts commit 1c05f3fb0a66c37da57a87de53e6bbb551ee51f7. Signed-off-by: Jim Harris <jim.harris@samsung.com> Change-Id: I7cff622722824dfad780359a7af259d359a20f4c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24535 Reviewed-by: Changpeng Liu <changpeliu@tencent.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
d87248df | 13-Aug-2024 |
Jim Harris <jim.harris@samsung.com> |
Revert "lib/vhost: assert to check if bvdev is not NULL"
This reverts commit d5eb9855ccfb15c200795f98c61584b6ad5a76b0.
This prepares for reverting 1c05f3fb0 ("vhost-blk: enable multiple threads pol
Revert "lib/vhost: assert to check if bvdev is not NULL"
This reverts commit d5eb9855ccfb15c200795f98c61584b6ad5a76b0.
This prepares for reverting 1c05f3fb0 ("vhost-blk: enable multiple threads poll group support").
As part of this patch, also revert a spelling fix that was made in 34edd9f1b ("general: fix misspells and typos"). This allows the follow-up revert to apply 100% cleanly.
Signed-off-by: Jim Harris <jim.harris@samsung.com> Change-Id: I7cff622722824dfad780359a7af259d359a20f4d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24534 Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
840a5d2e | 01-Aug-2024 |
xupeng-mingtu <jingmamour@gmail.com> |
lib/vhost: fix rpc vhost_delete_controller may block the entire reactor
When shutting down a vm, qemu will disconnect the session connection with vhost_block_controller. The dpdk-vhost-evt thread wi
lib/vhost: fix rpc vhost_delete_controller may block the entire reactor
When shutting down a vm, qemu will disconnect the session connection with vhost_block_controller. The dpdk-vhost-evt thread will handle the disconnection and unregister the memory, it will lock "user_dev->lock". If the vhost_delete_controller rpc is called before the memory unregister is completed, "user_dev->lock" also needs to be locked, so it will wait for the dpdk-vhost-evt thread to release the lock. During the waiting process, the reactor where app_thread is located will be blocked, causing other IO to not be processed.
Fixes issue #3468
Change-Id: I262b79c8b7ffa260941171b8058b443bcf827cf4 Signed-off-by: xupeng-mingtu <jingmamour@gmail.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24402 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: GangCao <gang.cao@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
show more ...
|
34edd9f1 | 10-Jul-2024 |
Kamil Godzwon <kamilx.godzwon@intel.com> |
general: fix misspells and typos
Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com> Change-Id: Iab206ef526eb7032c6681a3145450010c91705a4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+
general: fix misspells and typos
Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com> Change-Id: Iab206ef526eb7032c6681a3145450010c91705a4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24120 Community-CI: Mellanox Build Bot Reviewed-by: Karol Latecki <karol.latecki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
d5eb9855 | 07-Jun-2024 |
Marcin Spiewak <marcin.spiewak@intel.com> |
lib/vhost: assert to check if bvdev is not NULL
Fixed issue detected by Coverity. Added assert() to make sure bvdev returned from to_blk_dev() function is not NULL. This is common practice in the vh
lib/vhost: assert to check if bvdev is not NULL
Fixed issue detected by Coverity. Added assert() to make sure bvdev returned from to_blk_dev() function is not NULL. This is common practice in the vhost_blk.c file, but in one place the assert() was missing.
Change-Id: I47cbede9064cf6010c15d216b2f0879373ea2f1a Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23609 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Community-CI: Mellanox Build Bot
show more ...
|
aa17f615 | 21-May-2024 |
Jim Harris <jim.harris@samsung.com> |
vhost: check != 0 for pthread_create() return value
pthread_create() returns a positive errno when it fails, so the "rc < 0" check was invalid - it needs to be "rc != 0".
Note: found while debuggin
vhost: check != 0 for pthread_create() return value
pthread_create() returns a positive errno when it fails, so the "rc < 0" check was invalid - it needs to be "rc != 0".
Note: found while debugging an LTO compilation warning related to this function.
Signed-off-by: Jim Harris <jim.harris@samsung.com> Change-Id: If232d8c4aa113d6f3f8049f3bc8f5fd0c197d052 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23304 Reviewed-by: Ben Walker <ben@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Community-CI: Mellanox Build Bot
show more ...
|
1c05f3fb | 03-Apr-2024 |
Changpeng Liu <changpeng.liu@intel.com> |
vhost-blk: enable multiple threads poll group support
The patch set is largely based on Jaylyn Ren's https://review.spdk.io/gerrit/c/spdk/spdk/+/16067 and https://review.spdk.io/gerrit/c/spdk/spdk/+
vhost-blk: enable multiple threads poll group support
The patch set is largely based on Jaylyn Ren's https://review.spdk.io/gerrit/c/spdk/spdk/+/16067 and https://review.spdk.io/gerrit/c/spdk/spdk/+/16068 patches to enable multiple threads support for vhost-blk, here I enable multiple theads based on vhost session, this will make the code more readable and easy to maintain.
For vhost-blk device using single core, it's same as before, if the device is created with multiple core masks, we will start one thread per core for the device, this is helpful when no competition on these cores, >= 2 IO queues per thread is recommended in practice.
SPDK already has the CI test(lvol) case to create vhost-blk device with the same core mask as vhost application, then for this case, multiple threads are created for this vhost-blk device.
Signed-off-by: Jaylyn Ren <Jaylyn.Ren@arm.com> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Change-Id: I7cff622722824dfad780359a7af259d359a20f4b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22616 Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
cc7971b6 | 17-May-2024 |
Changpeng Liu <changpeng.liu@intel.com> |
lib/vhost: show default cpumask is used or not
When creating a vhost device without input the cpumask, vhost library will use application's cpumask by default, here we add a flag to mark this case.
lib/vhost: show default cpumask is used or not
When creating a vhost device without input the cpumask, vhost library will use application's cpumask by default, here we add a flag to mark this case.
Change-Id: Ib6387e841b7705873e84f9707a24b1552add6e24 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23200 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
71c1bbee | 21-May-2024 |
Haoqian He <haoqian.he@smartx.com> |
vhost: fix the no fd SET_VRING_CALL/SET_VRING_KICK issue
According vHost-user SPEC, for SET_VRING_KICK and SET_VRING_CALL message, bits (0-7) of the payload contain the vring index and bit 8 is the
vhost: fix the no fd SET_VRING_CALL/SET_VRING_KICK issue
According vHost-user SPEC, for SET_VRING_KICK and SET_VRING_CALL message, bits (0-7) of the payload contain the vring index and bit 8 is the invalid FD flag.
We should use VHOST_USER_VRING_IDX_MASK to get the correct qid. Otherwise, if ancillary data doesn't have fd, we will get error from post_msg_handler functions cuz bit 8 is set.
Change-Id: I714a048c1d2f82abc98d66ed77e10a93ad271b58 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23265 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
40b11d96 | 09-May-2024 |
Changpeng Liu <changpeng.liu@intel.com> |
lib/vhost: define timeout values when stopping a session
These timeout values are hardcoded now, define macros instead.
Change-Id: I664786a94641471406f07ada966fa10316ac435e Signed-off-by: Changpeng
lib/vhost: define timeout values when stopping a session
These timeout values are hardcoded now, define macros instead.
Change-Id: I664786a94641471406f07ada966fa10316ac435e Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23055 Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
5c366748 | 11-Apr-2024 |
Changpeng Liu <changpeng.liu@intel.com> |
vhost: rename register_vq_interrupt callback
Register the vring's interrupt fd is part of the process of vq enablement, here we rename it to enable_vq callback then we can add more code in the comin
vhost: rename register_vq_interrupt callback
Register the vring's interrupt fd is part of the process of vq enablement, here we rename it to enable_vq callback then we can add more code in the coming patch.
Change-Id: Ie1973440064f1255510982cdf41784e1286b4409 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22735 Reviewed-by: Jim Harris <jim.harris@samsung.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
show more ...
|
0fd542bc | 11-Apr-2024 |
Changpeng Liu <changpeng.liu@intel.com> |
vhost: remove session interrupt mode flag
Interrupt mode is a global configuration when starting SPDK, `vhost_vq_avail_ring_get` and `vhost_vq_used_ring_enqueue` will not be called before the device
vhost: remove session interrupt mode flag
Interrupt mode is a global configuration when starting SPDK, `vhost_vq_avail_ring_get` and `vhost_vq_used_ring_enqueue` will not be called before the device is started, just use the global configuration flag is OK.
Change-Id: I33ca96a4e39d0fc2657ab4a410ad9daf496446bb Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22734 Reviewed-by: Jim Harris <jim.harris@samsung.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
9b562bdf | 28-Feb-2024 |
Yuhua <yuhua@smartx.com> |
lib/vhost: split the global dpdk semaphore
The g_dpdk_sem is used to wait for a vsession to complete an asynchronous workload on the DPDK side, splitting it into each session can be more flexible.
lib/vhost: split the global dpdk semaphore
The g_dpdk_sem is used to wait for a vsession to complete an asynchronous workload on the DPDK side, splitting it into each session can be more flexible.
Change-Id: Ie59638d09071440f015985018b440159ab8c7ad1 Signed-off-by: Yuhua He <yuhua@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22170 Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
355312bf | 26-Jan-2024 |
Tomasz Zawadzki <tomasz.zawadzki@intel.com> |
so_ver: increase all major versions after SPDK 24.01
To allow SO_MINOR updates on LTS for the whole year it is supported, the major version for all components needs to be increased. This is to preve
so_ver: increase all major versions after SPDK 24.01
To allow SO_MINOR updates on LTS for the whole year it is supported, the major version for all components needs to be increased. This is to prevent scenario where two versions exists with matching versions, but conflicting ABI. Ex. Next SPDK release adds an API call increasing the minor version, then LTS needs just a subset of those additions.
Increasing major so version after LTS, allows the future releases to update versions as needed. Yet allowing LTS to increase minor version separately.
This patch: - increases SO_VER by 1 for all components - resets SO_MINOR to 0 for all components
Due to patch below being introduced after v24.01 code freeze, bdev lib version should not be increased: 61623c5ca9 bdev: add spdk_bdev_io padding in place of io_submit_ch
Short reference to how the versions were changed: MAX=$(git grep "SO_VER := " | cut -d" " -f 3 | sort -ubnr | head -1) for((i=$MAX;i>0;i-=1)); do find . -name "Makefile" -exec \ sed -i -e "s/SO_VER := $i\$/SO_VER := $(($i+1))/g" {} +; done find . -name "Makefile" -exec \ sed -i -e "s/SO_MINOR := .*/SO_MINOR := 0/g" {} +
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I0166d6be6c17bbbf985d48b5dfcb36f1d4af1b48 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21582 Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
d65bd99e | 27-Sep-2023 |
Pierre Lestringant <plestringant@kalray.eu> |
include: Remove duplicate includes in source files
Change-Id: I7dd6ae6fa11603a956c3d178b9b23d2c755913d1 Signed-off-by: Pierre Lestringant <plestringant@kalray.eu> Reviewed-on: https://review.spdk.io
include: Remove duplicate includes in source files
Change-Id: I7dd6ae6fa11603a956c3d178b9b23d2c755913d1 Signed-off-by: Pierre Lestringant <plestringant@kalray.eu> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20106 Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
4f01d6e5 | 22-Nov-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost: check the starting flag when handle vhost msg
When the backend is prepared to live recovery, and adding memory to the vm immediately, the vsession may be in starting state, and the process_vq
vhost: check the starting flag when handle vhost msg
When the backend is prepared to live recovery, and adding memory to the vm immediately, the vsession may be in starting state, and the process_vq poller will start when memory layout is updating.
Change-Id: I723cef612d6f1fe96513e20e9eb65a5405f5e273 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20661 Reviewed-by: Jim Harris <jim.harris@samsung.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|
dc93bd85 | 30-Aug-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost-scsi: add new rpc to enhance live recovery
After the vhost-scsi controller is started, qemu can reconnect to spdk, but at this time the LUN may not be added to the scsi target, struct spdk_scs
vhost-scsi: add new rpc to enhance live recovery
After the vhost-scsi controller is started, qemu can reconnect to spdk, but at this time the LUN may not be added to the scsi target, struct spdk_scsi_dev_vhost_state's member dev has not been set yet, which will lead to IO error subsequently.
So we add a vhost_create_scsi_controller RPC option to create controller but doesn't start it, and add a new RPC to start the controller separately.
Change-Id: I1f8a78528de3073293d1c5ce2c064123519bc320 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19590 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Community-CI: Mellanox Build Bot
show more ...
|
f99cce9c | 14-Nov-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost: Split vhost_user_dev_register into two functions
Split vhost_user_dev_register into two steps: 1. vhost_user_dev_init only initializes user_dev. 2. vhost_user_dev_start creates the socket a
vhost: Split vhost_user_dev_register into two functions
Split vhost_user_dev_register into two steps: 1. vhost_user_dev_init only initializes user_dev. 2. vhost_user_dev_start creates the socket and startup controller.
This patch is pre-patch for enhancing vhost-scsi live recovery.
Change-Id: I66d27595151c82e56ba03cea1abf8df273db75bc Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20594 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
df8d361f | 05-Nov-2023 |
Jie Wang <wangjie88@huawei.com> |
lib/vhost: fix memory barrier miss before read avail flags
When guest enabling interrupts, vhost need paired with the barrier that the Guest executes. Otherwise maybe miss vhost_vq_used_signal and o
lib/vhost: fix memory barrier miss before read avail flags
When guest enabling interrupts, vhost need paired with the barrier that the Guest executes. Otherwise maybe miss vhost_vq_used_signal and occur IO hang.
Change-Id: I62775aea0b9ae48eea5d44e22732b5e7481a2198 Signed-off-by: Jie Wang <wangjie88@huawei.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20504 Reviewed-by: Jim Harris <jim.harris@samsung.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
show more ...
|
29c6115c | 26-Oct-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost: fix memory issue when spdk exit
When spdk exit, if stop session timeout, vhost memory will be unmapped, we cannot access vring anymore.
The funciton call path is: vhost_scsi_subsystem_fini
vhost: fix memory issue when spdk exit
When spdk exit, if stop session timeout, vhost memory will be unmapped, we cannot access vring anymore.
The funciton call path is: vhost_scsi_subsystem_fini -> spdk_vhost_scsi_fini -> vhost_user_fini -> vhost_user_session_shutdown -> _stop_session (timeout) -> vhost_driver_unregister (unmap vhost memory) -> vhost_fini -> spdk_vhost_dev_remove -> spdk_vhost_scsi_dev_remove_tgt -> vhost_scsi_session_remove_tgt -> eventq_enqueue (access vring and crash)
So We can skip calling vhost_driver_unregister when _stop_session return error.
Change-Id: I250cfbc1edb288babea7658d005c2e7292ce68e5 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20452 Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <jim.harris@samsung.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
show more ...
|
a6824b5e | 13-Oct-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost_scsi: don't free svdev when vhost_dev_unregister failed
In vhost_scsi, when vhost_dev_unregister failed, svdev should not be free like vhost_blk.
Change-Id: Ic090e3cf1d2af590fc435ba68abad85d1
vhost_scsi: don't free svdev when vhost_dev_unregister failed
In vhost_scsi, when vhost_dev_unregister failed, svdev should not be free like vhost_blk.
Change-Id: Ic090e3cf1d2af590fc435ba68abad85d1282f265 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20338 Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com>
show more ...
|
c0aa9f19 | 11-Oct-2023 |
Haoqian He <haoqian.he@smartx.com> |
vhost: make vhost_dev_unregister thread safe
In function vhost_dev_unregister, before removing vdev from the global linked list g_vhost_devices, other threads may access vdev member but some of them
vhost: make vhost_dev_unregister thread safe
In function vhost_dev_unregister, before removing vdev from the global linked list g_vhost_devices, other threads may access vdev member but some of them have been free at this time, causing uaf. E.g. When live migration, destroy_connection may access vdev->ctxt by vhost_session_find_by_vid at the same time.
So we use spdk_vhost_lock to prevent other threads from accessing vdev members(e.g. user_dev(ctxt), name, path) which have been free.
Change-Id: I81cc91633770c6b08f36b43545ed57cbb309aa01 Signed-off-by: Haoqian He <haoqian.he@smartx.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20273 Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
show more ...
|