Spdk/lib/nvmf
Jim Harris b1a2319686 nvmf: retry QID check if duplicate detected
A host will consider a QID as reusable once it disconnects
from the target.  But our target does not immediately
free the QID's bit from the ctrlr->qpair_mask - it waits
until after a message is sent to the ctrlr's thread.

So this opens up a small window where the host makes
a valid connection with a recently free QID, but the
target rejects it.

When this happens, we will now start a 100us poller, and
recheck again.  This will give those messages time to
execute in this case, and avoid unnecessarily rejecting
the CONNECT command.

Tested with local patch that injects 10us delay before
clearing bit in qpair_mask, along with fused_ordering
test that allocates and frees qpair in quick succession.
Also tested with unit tests added in this patch.

Fixes issue #2955.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I850b895c29d86be9c5070a0e6126657e7a0578fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17362
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-04-07 17:47:13 +00: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-04-07 17:47:13 +00:00
fc_ls.c update Intel copyright notices 2022-11-10 08:28:53 +00: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 nvmf: point poll_groups back to their spdk_nvmf_tgt 2023-03-28 20:17:21 +00: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, nvmf/rdma: default to dynamic buf_cache_size 2023-03-28 20:17:21 +00: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: move cq_is_full() closer to caller 2023-04-06 21:14:38 +00:00