From a1a41626e8d6c136cc98d38b83c4e9389941f934 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 15 Jan 2026 09:59:56 +0100 Subject: [PATCH 1/2] fabrics: open transport handle for discovery controller The discovery controller is using the identify command and also the get log page command. Thus, create the transport handle for the discovery controller. Signed-off-by: Daniel Wagner --- libnvme/src/nvme/fabrics.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnvme/src/nvme/fabrics.c b/libnvme/src/nvme/fabrics.c index 6917e66141..274aa17d9a 100644 --- a/libnvme/src/nvme/fabrics.c +++ b/libnvme/src/nvme/fabrics.c @@ -2313,6 +2313,12 @@ static int nvmf_create_discovery_ctrl(struct nvme_global_ctx *ctx, return -ENOMEM; } + ret = nvme_open(ctx, c->name, &c->hdl); + if (ret) { + nvme_msg(ctx, LOG_ERR, "failed to open %s\n", c->name); + return ret; + } + /* Find out the name of discovery controller */ ret = nvme_ctrl_identify(c, id); if (ret) { From c912140708f253daa874d4747996b7a81a57b5f6 Mon Sep 17 00:00:00 2001 From: Martin George Date: Sun, 4 Jan 2026 16:57:14 +0530 Subject: [PATCH 2/2] fabrics: fix concat during nvme connect-all During nvme connect-all, if a discovery log page record reports the sectype as anything other than NVMF_TCP_SECTYPE_NONE in nvmf_connect_disc_entry(), it then assumes that --tls should be default set for the same. But this holds true only for configured PSK TLS alone and not for generated PSK TLS. For generated PSK TLS connections using --concat (i.e. secure channel concat), this would lead to connection failures since both --tls and --concat are not to be invoked together. Fix this by distinguishing the two through their respective treq values and setting the appropriate --tls or --concat flags for each. Signed-off-by: Martin George --- libnvme/src/nvme/fabrics.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libnvme/src/nvme/fabrics.c b/libnvme/src/nvme/fabrics.c index 274aa17d9a..3ca0f22518 100644 --- a/libnvme/src/nvme/fabrics.c +++ b/libnvme/src/nvme/fabrics.c @@ -1193,8 +1193,12 @@ static int nvmf_connect_disc_entry(nvme_host_t h, c->cfg.disable_sqflow = true; if (e->trtype == NVMF_TRTYPE_TCP && - e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE) - c->cfg.tls = true; + e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE) { + if (e->treq & NVMF_TREQ_REQUIRED) + c->cfg.tls = true; + else if (e->treq & NVMF_TREQ_NOT_REQUIRED) + c->cfg.concat = true; + } ret = nvmf_add_ctrl(h, c, cfg); if (!ret) {