bdev/nvme: Cache non-optimized path for active/active policy

Non-optimized path was not cached for active/active policy unexpectedly.
Fix the bug in this patch.

This will simplify the code and will be helpful to add more algorithms a
little.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I233d9fa6eca73b1e0fb850c7ea4b3474aff6fc1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16190
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Richael <richael.zhuang@arm.com>
This commit is contained in:
Shuhei Matsumoto 2023-01-09 22:14:58 +09:00 committed by Jim Harris
parent 8346b57397
commit 4f33deb89c

View File

@ -876,15 +876,12 @@ _bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch)
static inline struct nvme_io_path *
bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch)
{
if (spdk_unlikely(nbdev_ch->current_io_path == NULL)) {
return _bdev_nvme_find_io_path(nbdev_ch);
if (spdk_likely(nbdev_ch->current_io_path != NULL &&
nbdev_ch->mp_policy == BDEV_NVME_MP_POLICY_ACTIVE_PASSIVE)) {
return nbdev_ch->current_io_path;
}
if (spdk_likely(nbdev_ch->mp_policy == BDEV_NVME_MP_POLICY_ACTIVE_PASSIVE)) {
return nbdev_ch->current_io_path;
} else {
return _bdev_nvme_find_io_path(nbdev_ch);
}
return _bdev_nvme_find_io_path(nbdev_ch);
}
/* Return true if there is any io_path whose qpair is active or ctrlr is not failed,