Spdk/test/unit/lib/nvme
Alexey Marchuk 3512714b3f nvme_fabrics: Lock mutext when prcessing set/get regs
That is possible to get/set registers from any thread,
during regs processing we are polling admin qpair to
get a completion. At the same time, another thread
can also poll admin qpair and that can lead to
undefined behavior.

This patch fixes an issue when bdev_nvme is configured
with io_timeout. If remote target becomes unresponsive
(e.g. due to link down), IO timeout occurs and bdev_nvme
tries to get csts registers in timeout_cb. At the same
time another thread can process adminq, so we may have
2 simultaneous adminq polls. If admin qpair is disconnecting
at that time (RDMA transport) we may destroy resources
twice from different threads.

We don't see a problem with set_regs function but it
won't be redundant to lock mutex in set_regs as well.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I7ec3984d25d0249061005533d13b22315b44ddf2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13687
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-07-15 16:06:54 +00:00
..
nvme_ctrlr_cmd.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_ctrlr_ocssd_cmd.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_ctrlr.c nvme: don't try to enable intel log pages on fabrics ctrlrs 2022-07-04 07:23:13 +00:00
nvme_cuse.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_fabric.c nvme_fabrics: Lock mutext when prcessing set/get regs 2022-07-15 16:06:54 +00:00
nvme_io_msg.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_ns_cmd.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_ns_ocssd_cmd.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_ns.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_opal.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_pcie_common.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_pcie.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_poll_group.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvme_qpair.c nvme: Add ctrlr_abort_queued_aborts() into qpair_abort_all_queued_reqs() 2022-06-30 07:51:23 +00:00
nvme_quirks.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
nvme_rdma.c nvme: add cmd/cpl printing for rdma errors 2022-07-04 07:23:13 +00:00
nvme_tcp.c nvme: add cmd/cpl printing for tcp errors 2022-07-04 07:23:13 +00:00
nvme_transport.c nvme: make spdk_nvme_ctrlr_free_io_qpair multi-process safe 2022-07-11 07:41:09 +00:00
nvme.c check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00