From: Daniel Wagner Date: Tue, 17 Jan 2023 08:32:19 +0000 (+0100) Subject: fabrics: Prefer unique disc ctrl over well known X-Git-Tag: v2.3~12^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e5fa63e807122d233468dee2a59a2c3279431f27;p=users%2Fsagi%2Fnvme-cli.git fabrics: Prefer unique disc ctrl over well known Currently, the well known discovery controller is used per default even though the target might support unique discovery controller as defined in TP8013. Change the default behavior to use the unique discovery controller whenever the target supports it. Signed-off-by: Daniel Wagner --- diff --git a/fabrics.c b/fabrics.c index 82017e2b..533cecee 100644 --- a/fabrics.c +++ b/fabrics.c @@ -227,6 +227,8 @@ static nvme_ctrl_t __create_discover_ctrl(nvme_root_t r, nvme_host_t h, return NULL; nvme_ctrl_set_discovery_ctrl(c, true); + nvme_ctrl_set_unique_discovery_ctrl(c, + strcmp(trcfg->subsysnqn, NVME_DISC_SUBSYS_NAME)); tmo = set_discovery_kato(cfg); errno = 0; @@ -251,7 +253,7 @@ static nvme_ctrl_t create_discover_ctrl(nvme_root_t r, nvme_host_t h, if (!c) return NULL; - if (!persistent) + if (nvme_ctrl_is_unique_discovery_ctrl(c)) return c; /* Find out the name of discovery controller */