linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] nvme-cli: fabrics: Fix passing "host_traddr" for all transports
@ 2018-03-08 17:38 Max Gurtovoy
  2018-03-08 17:49 ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: Max Gurtovoy @ 2018-03-08 17:38 UTC (permalink / raw)


Currently only FC transport passes "host_traddr" to the kernel during
nvme connect-all command. Fix it for all transports.

Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
 fabrics.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fabrics.c b/fabrics.c
index 4bdaaf2..774d5dc 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -614,6 +614,14 @@ static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e)
 		p += len;
 	}
 
+	if (cfg.host_traddr) {
+		len = sprintf(p, ",host_traddr=%s", cfg.host_traddr);
+		if (len < 0)
+			return -EINVAL;
+		p+= len;
+	}
+
+
 	switch (e->trtype) {
 	case NVMF_TRTYPE_LOOP: /* loop */
 		len = sprintf(p, ",transport=loop");
@@ -659,11 +667,6 @@ static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e)
 				return -EINVAL;
 			p += len;
 
-			len = sprintf(p, ",host_traddr=%s", cfg.host_traddr);
-			if (len < 0)
-				return -EINVAL;
-			p+= len;
-
 			len = sprintf(p, ",traddr=%.*s",
 				      space_strip_len(NVMF_TRADDR_SIZE, e->traddr),
 				      e->traddr);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 1/1] nvme-cli: fabrics: Fix passing "host_traddr" for all transports
  2018-03-08 17:38 [PATCH 1/1] nvme-cli: fabrics: Fix passing "host_traddr" for all transports Max Gurtovoy
@ 2018-03-08 17:49 ` Keith Busch
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2018-03-08 17:49 UTC (permalink / raw)


Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-08 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-08 17:38 [PATCH 1/1] nvme-cli: fabrics: Fix passing "host_traddr" for all transports Max Gurtovoy
2018-03-08 17:49 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).