numam-spdk/module
Alexey Marchuk 11f0a6ec0f nvmf: Destroy subsystems before destroying poll groups
When nvmf_tgt application shuts down, it stops all
subsystems, than destroyes poll groups and than
destroyes nvmf_tgt. Part of nvmf_tgt destruction is
destruction of subsystems and this process may require
cross thread communication but since poll groups and
threads are already destroyed, we may get segfaults.

One possible solution is to change the order and destroy
nvmf_tgt before destroying poll groups but it doesn't
work since nvmf_tgt is registered as io_device and
poll groups have its channel, so it can't be destroyed
while poll groups exist.

This patch adds a new state to nvmf_tgt state machine
which destroys all subsystems before destroying poll
groups and nvmf_tgt. It guarantees that all threads
exist when subsystems are destroyed.

Also rename state NVMF_TGT_FINI_FREE_RESOURCES to
NVMF_TGT_FINI_DESTROY_TARGET, the new name better
reflects the purpose of this state.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I08971d78cc9ad70d43cd43c346fd74d35c8bda60
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9668
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-01-20 20:00:51 +00:00
..
accel accel: Don't query the channel queue depth. Rely on -EBUSY 2022-01-20 07:54:55 +00:00
bdev Lib/iSCSI: add the LUN Resize support 2022-01-20 07:56:23 +00:00
blob blob: use uint64_t for unmap and write_zeroes lba count 2021-10-14 08:17:16 +00:00
blobfs blobfs: check return value of strdup in blobfs_fuse_start() 2021-06-16 08:53:21 +00:00
env_dpdk so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
event nvmf: Destroy subsystems before destroying poll groups 2022-01-20 20:00:51 +00:00
scheduler gscheduler: use current tsc for decision. 2021-12-31 09:21:27 +00:00
sock sock: Fix SPDK_ZEROCOPY do not work for IPV6 2021-11-30 09:09:03 +00:00
Makefile scheduler: create public API and subsystem for scheduler/governor 2021-09-07 07:33:03 +00:00