[libnvme,v3,2/2] fabrics: Do not pass disable_sqflow if not supported

Message ID 20230808091550.25349-3-dwagner@suse.de
State New
Headers
Series Do not pass disable_sqflow if not supported |

Commit Message

Daniel Wagner Aug. 8, 2023, 9:15 a.m. UTC
  From: Sagi Grimberg <sagi@grimberg.me>

Only retry a connect attempt with disable_sqflow if the kernel
actually supports this option.

Reported-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 src/nvme/fabrics.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Sagi Grimberg Aug. 8, 2023, 10:50 a.m. UTC | #1
> From: Sagi Grimberg <sagi@grimberg.me>

You can make the patch from you, you are sending it after all..

> Only retry a connect attempt with disable_sqflow if the kernel
> actually supports this option.

commit msg needs update.
  

Patch

diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c
index 9725eeb3cda8..11d99580072a 100644
--- a/src/nvme/fabrics.c
+++ b/src/nvme/fabrics.c
@@ -1031,8 +1031,11 @@  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 &&
+	    nvmf_check_option(h->r, disable_sqflow))
 		c->cfg.disable_sqflow = true;
+	else
+		c->cfg.disable_sqflow = false;
 
 	if (e->trtype == NVMF_TRTYPE_TCP &&
 	    (e->treq & NVMF_TREQ_REQUIRED ||