Previously NVMe-oF target had requested each thread to destroy its poll group, but had moved to the next state without waiting for completion. To create and destroy poll group threads dynamically, NVMe-oF target have to know the completion of poll group destroy. The reason is as follows. spdk_thread_exit() requires that each poll group thread to unregister its pollers, but poller unregistration is done asynchronously, and releaes its I/O channels, but I/O channel release is done asynchronously. This patch does the following. To avoid using mutex, add the init thread. spdk_for_each_thread() requires completion callback but the completion callback is usable only if each message handler is synchronous. spdk_nvmf_poll_group_destroy() is asynchronous now. So replace spdk_for_each_thread() by parsing g_poll_groups and sending message to each corresonding thread. Then add comletion callback nvmf_tgt_destroy_poll_group_done() to spdk_nvmf_poll_group_destroy(). nvmf_tgt_destroy_poll_group_done() sends message to the init thread. The init thread executes _nvmf_tgt_destroy_poll_group_done(). _nvmf_tgt_destroy_poll_group_done() decrements g_num_poll_groups and move to the next state if it becomes zero. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I97eb90b9dbff29d7702b20cf7ac233d39d7216b6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/496 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> |
||
---|---|---|
.. | ||
accel | ||
bdev | ||
blob | ||
blobfs | ||
env_dpdk | ||
event | ||
sock | ||
Makefile |