bdev_nvme: Support multipath across all discovery contexts.

This is required when volume is attached via different storage boxes
for example while migrating it.

Signed-off-by: Gili Buzaglo <gili.buzaglo@kioxia.com>
Change-Id: I680c781ae5de078972d6aef547804d60fff3c643
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16407
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
buzagg 2023-01-22 16:14:20 +02:00 committed by Jim Harris
parent cb2f0a2cf5
commit be299bf533

View File

@ -5696,11 +5696,17 @@ discovery_log_page_cb(void *cb_arg, int rc, const struct spdk_nvme_cpl *cpl,
}
}
if (!found) {
struct discovery_entry_ctx *subnqn_ctx, *new_ctx;
struct discovery_entry_ctx *subnqn_ctx = NULL, *new_ctx;
struct discovery_ctx *d_ctx;
TAILQ_FOREACH(subnqn_ctx, &ctx->nvm_entry_ctxs, tailq) {
if (!memcmp(subnqn_ctx->entry.subnqn, new_entry->subnqn,
sizeof(new_entry->subnqn))) {
TAILQ_FOREACH(d_ctx, &g_discovery_ctxs, tailq) {
TAILQ_FOREACH(subnqn_ctx, &d_ctx->nvm_entry_ctxs, tailq) {
if (!memcmp(subnqn_ctx->entry.subnqn, new_entry->subnqn,
sizeof(new_entry->subnqn))) {
break;
}
}
if (subnqn_ctx) {
break;
}
}