[PATCH libnvme] fabrics: don't pass sqflow_disable if the kernel does not support the option

Sagi Grimberg sagi at grimberg.me
Mon Jul 24 02:06:11 PDT 2023


Instead of retrying again without it.

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 src/nvme/fabrics.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c
index fd761d10d0cb..2a9d8dc7f23a 100644
--- a/src/nvme/fabrics.c
+++ b/src/nvme/fabrics.c
@@ -1026,7 +1026,7 @@ nvme_ctrl_t nvmf_connect_disc_entry(nvme_host_t h,
 		return NULL;
 	}
 
-	if (e->treq & NVMF_TREQ_DISABLE_SQFLOW)
+	if (e->treq & NVMF_TREQ_DISABLE_SQFLOW && h->r->options->disable_sqflow)
 		c->cfg.disable_sqflow = true;
 
 	if (e->trtype == NVMF_TRTYPE_TCP &&
@@ -1038,16 +1038,6 @@ nvme_ctrl_t nvmf_connect_disc_entry(nvme_host_t h,
 	if (!ret)
 		return c;
 
-	if (errno == EINVAL && c->cfg.disable_sqflow) {
-		errno = 0;
-		/* disable_sqflow is unrecognized option on older kernels */
-		nvme_msg(h->r, LOG_INFO, "failed to connect controller, "
-			 "retry with disabling SQ flow control\n");
-		c->cfg.disable_sqflow = false;
-		ret = nvmf_add_ctrl(h, c, cfg);
-		if (!ret)
-			return c;
-	}
 	nvme_free_ctrl(c);
 	return NULL;
 }
-- 
2.41.0




More information about the Linux-nvme mailing list