Spdk/test/unit/lib/bdev
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
..
bdev_zone.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
bdev.c bdev: add claim type 2023-01-05 23:28:32 +00:00
compress.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
crypto.c bdev/crypto: do not create mempool for session private data 2022-12-19 08:35:14 +00:00
gpt update Intel copyright notices 2022-11-10 08:28:53 +00:00
mt bdev: examine and register on app thread 2023-01-05 23:28:32 +00:00
nvme bdev/nvme: Retry I/O to the same path if error is I/O error 2023-01-13 00:47:04 +00:00
part.c bdev: replace internal buffer pools with iobuf 2022-12-16 09:06:07 +00:00
pmem update Intel copyright notices 2022-11-10 08:28:53 +00:00
raid raid5f: io metadata support 2023-01-11 09:08:52 +00:00
scsi_nvme.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
vbdev_lvol.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
vbdev_zone_block.c bdev: add claim type 2023-01-05 23:28:32 +00:00
Makefile configure: rename --with-reduce --with-vbdev-compress 2022-12-08 12:55:27 +00:00