Spdk/include/spdk
Jim Harris baf250e5e4 nvmf: initialize trid param in get_***_trid paths
When removing a listener, for example with
nvmf_subsystem_remove_listener RPC, we use the concept of a
"listen trid" to determine which existing connections
should be disconnected.

This listen trid has the trtype, adrfam, traddr and trsvcid
defined, but *not* the subnqn.  We use the subsystem pointer
itself to match the subsystem.

nvmf_stop_listen_disconnect_qpairs gets the listen trid
for each qpair, compares it to the trid passed by the
RPC, and if it matches, then it compares the subsystem
pointers and will disconnect the qpair if it matches.

The problem is that the spdk_nvmf_qpair_get_listen_trid
path does not initialize the subnqn to an empty string,
and in this case the caller does not initialize it either.
So sometimes the subnqn on the stack used to get the
qpair's listen trid ends up with some garbage as the subnqn
string, which causes the transport_id_compare to fail, and
then the qpair won't get disconnected even if the other
trid fields and subsystem pointers match.

For the failover.sh test, this means that the qpair doesn't
get disconnected, so we never go down the reset path
on the initiator side and don't see the "Resetting" strings
expected in the log.

This similarly impacts the host/timeout.sh test, which is
also fixed by this patch.  There were multiple failing
signatures, all related to remove_listener not working
correctly due to this bug.

While the get_listen_trid path is the one that caused
these bugs, the get_local_trid and get_peer_trid paths
have similar problems, so they are similarly fixed in
this patch.

Fixes issue #2862.
Fixes issue #2595.
Fixes issue #2865.
Fixes issue #2864.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I36eb519cd1f434d50eebf724ecd6dbc2528288c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17788
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: <sebastian.brzezinka@intel.com>
2023-04-27 09:24:18 +00:00
..
accel_module.h accel: collect stats on the number of processed bytes 2023-04-26 11:15:40 +00:00
accel.h accel: add method for getting per-channel opcode stats 2023-04-26 11:15:40 +00:00
assert.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
barrier.h barrier: LOONGARCH memory barriers 2023-01-06 15:54:46 +00:00
base64.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
bdev_module.h bdev: always generate UUIDs 2023-04-13 12:12:58 +00:00
bdev_zone.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
bdev.h bdev: accel sequence support for write requests 2023-03-13 21:02:27 +00:00
bit_array.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
bit_pool.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
blob_bdev.h blob_bdev: fix doc for spdk_bs_bdev_claim 2023-04-06 21:30:03 +00:00
blob.h blob: esnap clones are not clones 2023-04-26 17:32:13 +00:00
blobfs_bdev.h build: compile API functions with missing deps 2022-11-18 08:40:05 +00:00
blobfs.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
conf.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
cpuset.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
crc16.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
crc32.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
dif.h misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
dma.h dma: add "virtual" accel memory domain 2023-01-09 12:37:37 +00:00
endian.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
env_dpdk.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
env.h env: added support for lcore map 2023-04-10 17:58:20 +00:00
event.h env: added support for lcore map 2023-04-10 17:58:20 +00:00
fd_group.h util: Add spdk_fd_group_nest() and spdk_fd_group_unnest 2023-04-04 17:38:22 +00:00
fd.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
file.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
ftl.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
gpt_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
hexlify.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
histogram_data.h histogram_data: check bucket_shift when merging 2022-12-21 09:32:40 +00:00
idxd_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
idxd.h lib/idxd: Removed SPDK_IDXD_FLAG_PERSISTENT flag 2023-03-03 11:20:03 +00:00
init.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
ioat_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
ioat.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
json.h json: add spdk_json_write_named_double 2022-11-22 10:01:43 +00:00
jsonrpc.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
likely.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
log.h log: make macro parameters lowercase 2023-02-22 08:09:26 +00:00
lvol.h lvol: add spdk_lvol_get_by_* API 2023-04-26 17:32:13 +00:00
memory.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
mmio.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nbd.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
notify.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme_intel.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme_ocssd_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme_ocssd.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme_spec.h lib/nvme: include dword 13 field to extendable command structure 2023-03-09 23:22:41 +00:00
nvme_zns.h Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvme.h nvme: fix async_mode comment 2023-04-20 10:56:42 +00:00
nvmf_cmd.h nvmf: add spdk_nvmf_request_copy_*_buf() 2023-02-13 13:50:51 +00:00
nvmf_fc_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvmf_transport.h nvmf: retry QID check if duplicate detected 2023-04-07 17:47:13 +00:00
nvmf.h nvmf: initialize trid param in get_***_trid paths 2023-04-27 09:24:18 +00:00
opal_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
opal.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
pci_ids.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
pipe.h util/pipe: Fix documentation on spdk_pipe_create 2023-04-06 20:20:19 +00:00
queue_extras.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
queue.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
reduce.h bdev/compress: Port to use accel_fw instead of compressdev 2023-01-20 10:26:21 +00:00
rpc.h lib/rpc: add RPC allow list 2022-11-15 08:31:02 +00:00
scheduler.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
scsi_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
scsi.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
sock.h sock/uring: Flushing a socket not in a group still attempts to send 2023-01-19 17:34:01 +00:00
stdinc.h include: add libgen.h to stdinc.h 2023-04-26 17:32:13 +00:00
string.h util: Add spdk_strcpy_replace() to replace substrings 2023-01-10 13:12:05 +00:00
thread.h thread: Move get/put calls into .c file 2023-04-06 20:16:49 +00:00
trace_parser.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
trace.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
tree.h util: rename RB_ROOT into _RB_ROOT 2021-06-04 22:46:40 +00:00
ublk.h ublk: add configure and event/subsystem 2023-01-20 07:48:25 +00:00
util.h util: add spdk_iov_xfer_*() API 2023-01-30 16:28:35 +00:00
uuid.h uuid: add spdk_uuid_generate_sha1() 2023-02-28 08:57:01 +00:00
version.h version: SPDK 23.05 pre 2023-01-20 22:03:09 +00:00
vfio_user_pci.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vfio_user_spec.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vfu_target.h lib/vfu_target: add missed comments to vfu_target.h 2022-12-02 10:44:51 +00:00
vhost.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
vmd.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
xor.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
zipf.h update Intel copyright notices 2022-11-10 08:28:53 +00:00