Commit 4f33deb8 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

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: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I233d9fa6eca73b1e0fb850c7ea4b3474aff6fc1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16190


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarRichael <richael.zhuang@arm.com>
parent 8346b573
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -876,16 +876,13 @@ _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 true if there is any io_path whose qpair is active or ctrlr is not failed,
 * or false otherwise.