Spdk/test/unit/lib/bdev
Shuhei Matsumoto 22b77a3c80 bdev/nvme: Set preferred I/O path in multipath mode
If we specify a preferred path manually for each NVMe bdev, we will
be able to realize a simple static load balancing and make the failover
more controllable in the multipath mode.

The idea is to move I/O path to the NVMe-oF controller to the head of
the list and then clear the I/O path cache for each NVMe bdev channel.
We can set the I/O path to the I/O path cache directly but it must be
conditional and make the code very complex. Hence, let find_io_path() do
that.

However, a NVMe bdev channel may be acquired after setting the preferred
path. To cover such case, sort the nvme_ns list of the NVMe bdev too.

This feature supports only multipath mode. The NVMe bdev module supports
failover mode too. However, to support the latter, the new RPC needs to
have trid as parameters and the code and the usage will be come very
complex. Add a note for such limitation.

To verify one by one exactly, add unit test.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ia51c74f530d6d7dc1f73d5b65f854967363e76b0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12262
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: <tanl12@chinatelecom.cn>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-05 07:11:24 +00:00
..
bdev_zone.c spelling: test 2021-12-03 08:13:22 +00:00
bdev.c bdev: Add spdk_for_each_bdev/bdev_leaf for clean up and further improvements 2022-04-05 07:30:47 +00:00
compress.c bdev/compress: Verify mbuf chain if the driver doesn't suppot SGL 2022-03-31 09:34:52 +00:00
crypto.c module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
gpt test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
mt bdev: Fix race among bdev_reset(), bdev_close(), and bdev_unregister() 2022-04-22 09:45:14 +00:00
nvme bdev/nvme: Set preferred I/O path in multipath mode 2022-05-05 07:11:24 +00:00
part.c bdev: pull/push data if bdev doesn't support 2022-04-04 09:57:56 +00:00
pmem module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
raid bdev/raid: Add concat module 2022-04-05 07:39:00 +00:00
scsi_nvme.c test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
vbdev_lvol.c bdev/lvol: unload empty lvs during fini_start 2021-08-23 08:49:56 +00:00
vbdev_zone_block.c module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
Makefile ut/bdev_ocssd: Move bdev_ocssd_ut from bdev directory to bdev/nvme directory 2021-02-09 11:29:53 +00:00