Spdk/test
Jim Harris d33497d3f4 thread: defer unregistration when for_each ops exist
There may be for_each operations outstanding on an
io_device when it is unregistered.  Currently we just
return when this happens, not unregistering the
device but also not notifying the caller that this
happened (since it returns void, and the callback
function doesn't have a status parameter either).

We could just push this responsibility to the caller,
to never unregister an io_device if it knows it has
outstanding for_each calls waiting to complete.  But
I think we can simplify this a lot by just handling
this inside of the thread library.  Mark that the
device is pending registration, and unregister it
(on the original requesting thread!) when the
for_each count gets back to zero.  Also don't
allow any new for_each operations either.

Note this requires a bit of refactoring on the
thread unit tests, since it is now possible to
unregister a device with outstanding for_each
operations.

Fixes issue #2631.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I978f2d99a25e65d2b7d71ce9b1926a79a6c94263
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13890
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-08-09 08:27:15 +00:00
..
accel_engine accel: add ISAL based compress/decompress to accel SW module 2022-05-23 19:10:46 +00:00
app module/bdev_virtio_scsi: use the correct num_queues value 2022-08-04 11:24:40 +00:00
bdev Test/Bdev: wait PID to exit on error testing 2022-08-02 15:10:02 +00:00
blobfs check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
blobstore test/blobstore: Generate json config with single nvme bdev 2022-07-28 06:56:05 +00:00
common test/vfio: Add override switch for selecting vfio-qemu bin 2022-08-09 08:26:45 +00:00
compress bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
cpp_headers Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
dd test/dd: Simple tests utilizing uring RPCs 2021-12-20 08:46:13 +00:00
dma check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
dpdk_memory_utility check_format: Ignore shellcheck's SC2128 and SC2178 directives 2021-06-30 22:43:05 +00:00
env check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
event check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
external_code check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
fuzz nvme_fuzz: pass trid on command line only 2021-09-27 10:55:34 +00:00
interrupt scripts: move python modules to python directory 2022-04-05 14:40:47 +00:00
ioat build: Example applications build to build/example 2020-06-15 15:27:16 +00:00
iscsi_tgt sock: Add ktls and tls_version to spdk_sock_opts 2022-06-30 07:44:26 +00:00
json_config bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
lvol bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
make test: avoid private and public headers w/ same name 2022-07-21 08:12:21 +00:00
nvme test/reset: Remove unused usage. 2022-08-08 13:48:49 +00:00
nvmf test/nvmf/timeout.sh: use randread as the test case 2022-08-05 08:29:11 +00:00
ocf test/fio: supress fio output files 2022-06-23 07:43:36 +00:00
openstack openstack: change transport type to tcp 2022-06-29 07:09:48 +00:00
pmem bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
rpc scripts: move python modules to python directory 2022-04-05 14:40:47 +00:00
rpc_client check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
rpc_plugins autotest: Use rpc_cmd() for rpc plugin-based tests 2021-04-02 08:22:42 +00:00
scheduler test/scheduler: wait for scheduler after thread creation in busy() 2022-06-20 09:56:09 +00:00
setup scripts/setup: Skip devices which have any valid data present 2022-04-06 07:21:17 +00:00
sma test/sma: add qemu test for nvmf/vfiouser subsystem 2022-08-01 08:45:58 +00:00
spdkcli event/vhost: separate vhost subsystem to scsi and blk 2022-05-20 09:20:07 +00:00
thread Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
unit thread: defer unregistration when for_each ops exist 2022-08-09 08:27:15 +00:00
vfio_user test/vfio: Add override switch for selecting vfio-qemu bin 2022-08-09 08:26:45 +00:00
vhost test/vfio: Add override switch for selecting vfio-qemu bin 2022-08-09 08:26:45 +00:00
vmd test: replace VMD_WHITELIST with VMD_ALLOWED 2020-12-03 09:41:07 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
spdk_cunit.h Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00