Spdk/lib/nvmf
Alexey Marchuk 49415f8ece lib/nvmf: Do not use cb_fn in spdk_nvmf_qpair_disconnect
Current implementation of spdk_nvmf_qpair_disconnect
saves and calls user's callback correctly only on
the first call. If this function is called when
qpair is already in the process of disconnect, the
cb_fn is called immediately, that may lead to stack
overflow.

In most of places this function is called with
cb_fn = NULL, that means that the real qpair disconnect
is not important for the app logic. Only in several
places (nvmf tgt shutdown flow) that is important to
wait for all qpairs to be disconnected.

Taking into account complexity related to possible stack
overflow, do not pass the cb_fn to spdk_nvmf_qpair_disconnect.
Instead, wait until a list of qpairs is empty in shutdown path.

Next patches will change spdk_nvmf_qpair_disconnect behaviour
when disconnect is in progress and deprecate cb_fn and ctx
parameters.

Fixes issue #2765

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Ie8d49c88cc009b774b45adab3e37c4dde4395549
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17163
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-05-09 17:58:11 +08:00
..
ctrlr_bdev.c bdev: Add default copy command support in bdev 2023-03-07 11:52:45 +00:00
ctrlr_discovery.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
ctrlr.c nvmf: retry QID check if duplicate detected 2023-05-09 17:58:11 +08:00
fc_ls.c lib/nvmf: Do not use cb_fn in spdk_nvmf_qpair_disconnect 2023-05-09 17:58:11 +08:00
fc.c nvmf/fc: fix memleaks 2023-03-06 13:21:38 +00:00
Makefile so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nvmf_fc.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf_internal.h nvmf: make async event and error related functions public 2023-03-31 17:41:35 +00:00
nvmf_rpc.c nvmf: introduce async transport create 2023-02-16 16:45:08 +00:00
nvmf.c lib/nvmf: Do not use cb_fn in spdk_nvmf_qpair_disconnect 2023-05-09 17:58:11 +08:00
rdma.c nvmf/tcp, nvmf/rdma: default to dynamic buf_cache_size 2023-03-28 20:17:21 +00:00
spdk_nvmf.map nvmf: make async event and error related functions public 2023-03-31 17:41:35 +00:00
subsystem.c nvmf: handle iovecs in reservation handling 2023-02-13 13:50:51 +00:00
tcp.c nvmf/tcp: Wait for PDUs to release when closing a qpair 2023-05-09 17:58:11 +08:00
transport.c nvmf: enable dynamic buf_cache_size calculation 2023-03-28 20:17:21 +00:00
transport.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vfio_user.c nvmf/vfio_user: Post SQ delete cpl when qpair is destroyed 2023-05-09 17:58:11 +08:00