bdev/nvme: Check not only I/O qpair but also adminq when finding optimal I/O path
For RDMA transport, adminq will find transport error first because usually only adminq polls CM events. Change-Id: I7b22cc8883bf02198f1a90d2654c1de6f2e736e6 Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11331 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
3edbcba287
commit
0b32309bf6
@ -748,6 +748,11 @@ nvme_io_path_is_connected(struct nvme_io_path *io_path)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (spdk_nvme_ctrlr_get_admin_qp_failure_reason(io_path->qpair->ctrlr->ctrlr) !=
|
||||
SPDK_NVME_QPAIR_FAILURE_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1242,6 +1247,9 @@ bdev_nvme_poll_adminq(void *arg)
|
||||
} else {
|
||||
bdev_nvme_failover(nvme_ctrlr, false);
|
||||
}
|
||||
} else if (spdk_nvme_ctrlr_get_admin_qp_failure_reason(nvme_ctrlr->ctrlr) !=
|
||||
SPDK_NVME_QPAIR_FAILURE_NONE) {
|
||||
bdev_nvme_clear_io_path_caches(nvme_ctrlr, NULL);
|
||||
}
|
||||
|
||||
return rc == 0 ? SPDK_POLLER_IDLE : SPDK_POLLER_BUSY;
|
||||
|
@ -797,6 +797,12 @@ spdk_nvme_ctrlr_is_failed(struct spdk_nvme_ctrlr *ctrlr)
|
||||
return ctrlr->is_failed;
|
||||
}
|
||||
|
||||
spdk_nvme_qp_failure_reason
|
||||
spdk_nvme_ctrlr_get_admin_qp_failure_reason(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
return spdk_nvme_qpair_get_failure_reason(&ctrlr->adminq);
|
||||
}
|
||||
|
||||
#define UT_ANA_DESC_SIZE (sizeof(struct spdk_nvme_ana_group_descriptor) + \
|
||||
sizeof(uint32_t))
|
||||
static void
|
||||
@ -3993,9 +3999,11 @@ test_find_io_path(void)
|
||||
.io_path_list = STAILQ_HEAD_INITIALIZER(nbdev_ch.io_path_list),
|
||||
};
|
||||
struct spdk_nvme_qpair qpair1 = {}, qpair2 = {};
|
||||
struct nvme_ctrlr_channel ctrlr_ch1 = {}, ctrlr_ch2 = {};
|
||||
struct nvme_qpair nvme_qpair1 = { .ctrlr_ch = &ctrlr_ch1, };
|
||||
struct nvme_qpair nvme_qpair2 = { .ctrlr_ch = &ctrlr_ch2, };
|
||||
struct spdk_nvme_ctrlr ctrlr1 = {}, ctrlr2 = {};
|
||||
struct nvme_ctrlr nvme_ctrlr1 = { .ctrlr = &ctrlr1, }, nvme_ctrlr2 = { .ctrlr = &ctrlr2, };
|
||||
struct nvme_ctrlr_channel ctrlr_ch1 = { .ctrlr = &nvme_ctrlr1, }, ctrlr_ch2 = { .ctrlr = &nvme_ctrlr2, };
|
||||
struct nvme_qpair nvme_qpair1 = { .ctrlr_ch = &ctrlr_ch1, .ctrlr = &nvme_ctrlr1, };
|
||||
struct nvme_qpair nvme_qpair2 = { .ctrlr_ch = &ctrlr_ch2, .ctrlr = &nvme_ctrlr2, };
|
||||
struct nvme_ns nvme_ns1 = {}, nvme_ns2 = {};
|
||||
struct nvme_io_path io_path1 = { .qpair = &nvme_qpair1, .nvme_ns = &nvme_ns1, };
|
||||
struct nvme_io_path io_path2 = { .qpair = &nvme_qpair2, .nvme_ns = &nvme_ns2, };
|
||||
|
Loading…
Reference in New Issue
Block a user