Spdk/test/unit/lib
Shuhei Matsumoto ae620784bd bdev/nvme: Retry I/O to the same path if error is I/O error
When an I/O gets an I/O error, the I/O path to which the I/O was
submitted may be still available. In this case, the I/O should be
retried to the same I/O path. However, a new I/O path was always
selected for an I/O retry.

For the active/passive policy, the same I/O path was selected naturally.
However, for the active/active policy, it was very likely that a
different I/O path was selected.

To use the same I/O path for an I/O retry, add a helper function
bdev_nvme_retry_io() into bdev_nvme_retry_ios() and replace
bdev_nvme_submit_request() by bdev_nvme_retry_io(). bdev_nvme_retry_io()
checks if nbdev_io->io_path is not NULL and is available. Then, call
_bdev_nvme_submit_request() if true, or call bdev_nvme_submit_request()
otherwise. For I/O path error, clear nbdev_io->io_path for
clarification. Add unit test to verify this change.

Linux kernel native NVMe multipath already takes this approach. Hence,
this change will be reasonable.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I7022aafd8b1cdd5830c4f743d64b080aa970cf8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16015
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Richael <richael.zhuang@arm.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-13 00:47:04 +00:00
..
accel module/accel: Add accel_dpdk_cryptodev 2023-01-11 09:16:59 +00:00
bdev bdev/nvme: Retry I/O to the same path if error is I/O error 2023-01-13 00:47:04 +00:00
blob blobstore: missing lock leads to md page race 2022-12-20 09:19:09 +00:00
blobfs update Intel copyright notices 2022-11-10 08:28:53 +00:00
dma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
env_dpdk update Intel copyright notices 2022-11-10 08:28:53 +00:00
event test/unit: call spdk_thread_exit() in reactor_ut 2022-11-23 08:22:04 +00:00
ftl update Intel copyright notices 2022-11-10 08:28:53 +00:00
idxd update Intel copyright notices 2022-11-10 08:28:53 +00:00
init subsystem: assert all subsystems initialized on app thread 2022-11-23 08:22:04 +00:00
ioat update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi iscsi: fix segfault when r2t 2022-11-29 17:21:18 +00:00
json json: add spdk_json_write_named_double 2022-11-22 10:01:43 +00:00
jsonrpc update Intel copyright notices 2022-11-10 08:28:53 +00:00
log log: add deprecated tracking API 2022-12-07 17:45:53 +00:00
lvol update Intel copyright notices 2022-11-10 08:28:53 +00:00
notify update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme nvme: add num_outstanding_reqs in spdk_nvme_qpair 2023-01-09 14:49:11 +00:00
nvmf lib/nvmf: fix req->data usage in nvmf_ctrlr_get_features() handlers 2023-01-06 15:54:18 +00:00
rdma rdma: Maintain per device PD which is persistent across reconnect 2022-08-12 08:59:43 +00:00
reduce test/reduce: fix missing mem free call and add test call to UT script 2022-12-08 12:55:27 +00:00
rpc update Intel copyright notices 2022-11-10 08:28:53 +00:00
scsi update Intel copyright notices 2022-11-10 08:28:53 +00:00
sock misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
thread thread: cache a number of iobuf buffers on each channel 2022-12-16 09:06:07 +00:00
util util: Add spdk_strcpy_replace() to replace substrings 2023-01-10 13:12:05 +00:00
vhost misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
json_mock.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
Makefile configure: rename --with-reduce --with-vbdev-compress 2022-12-08 12:55:27 +00:00