Spdk/lib
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 accel: add method for getting per-channel opcode stats 2023-04-26 11:15:40 +00:00
bdev accel: make spdk_accel_sequence_finish() void 2023-04-19 06:36:20 +00:00
blob blob: esnap clones are not clones 2023-04-26 17:32:13 +00:00
blobfs so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
conf so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
dma so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
env_dpdk env_dpdk: add ERRLOGs to help debug issue #2983 2023-04-25 16:54:59 +00:00
env_ocf lib/env_ocf: place allocator variable on hugepages 2023-04-21 23:49:28 +00:00
event app: use --lcores to map ids greater than 128 2023-04-10 17:58:20 +00:00
ftl so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
idxd lib/idxd: Removed SPDK_IDXD_FLAG_PERSISTENT flag 2023-03-03 11:20:03 +00:00
init init: rewrite subsystem_sort 2023-04-13 04:58:05 +00:00
ioat so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
iscsi iscsi: Return if conn->sock is NULL when updating connection params 2023-04-06 21:30:38 +00:00
json so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
jsonrpc freebsd: return negated error from getaddrinfo() 2023-03-10 16:44:37 +00:00
log so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
lvol vbdev_lvol: load esnaps via examine_config 2023-04-26 17:32:13 +00:00
mlx5 so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nbd so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
notify so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nvme nvme/tcp: increase timeout for async icreq response 2023-04-20 10:56:42 +00:00
nvmf nvmf: initialize trid param in get_***_trid paths 2023-04-27 09:24:18 +00:00
rdma so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
reduce libreduce: removing deprecation messages for pmem 2023-04-17 09:36:07 +00:00
rocksdb rocksdb: remove spdk_thread 2022-11-23 08:22:04 +00:00
rpc so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
scsi so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
sock sock: Allow flushing even if the socket is in a poll group 2023-01-24 18:18:33 +00:00
thread thread: Move get/put calls into .c file 2023-04-06 20:16:49 +00:00
trace so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
trace_parser so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
ublk lib/ublk: use page aligned data buffer 2023-03-28 10:20:50 +00:00
ut_mock so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
util util/pipe: Simplify some null checks 2023-04-06 20:20:19 +00:00
vfio_user so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
vfu_tgt so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
vhost lib/vhost: register VQ interrupt handler when enable VQ 2023-04-13 21:39:33 +00:00
virtio lib/virtio_vfio_user: use VIRTIO_PCI_VRING_ALIGN aligned vring address 2023-02-09 11:31:39 +00:00
vmd so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
Makefile ublk: add configure and event/subsystem 2023-01-20 07:48:25 +00:00