Skip to contentSkip to conversation

nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

PATCH New Duane Grigsby 5 participants 10 messages Feb 8, 2017 – Feb 21, 2017 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

This fix adds the "host_traddr" to the contructed string that is passed to the kernel.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
---
 fabrics.c | 5 +++++
 1 file changed, 5 insertions(+)
fabrics.c +5 -0
index 362ca6f..3f6be53 100644
@@ -595,6 +595,11 @@ 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", e->traddr);
 			if (len < 0)
 				return -EINVAL;
Signature · 1 line
1.7.10.GIT
#1 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Hi Darren,
Can you send an example for usage ?
I want to try this out.

thanks,
Max.

Quoted 25 lines · Duane Grigsby

This fix adds the "host_traddr" to the contructed string that is passed to the kernel.

Signed-off-by Darren Trapp <darren.trapp at cavium.com>
---
 fabrics.c | 5 +++++
 1 file changed, 5 insertions(+)
fabrics.c +5 -0
index 362ca6f..3f6be53 100644
@@ -595,6 +595,11 @@ 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", e->traddr);
 			if (len < 0)
 				return -EINVAL;
maintainer
#2 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

In reply to Duane Grigsby

fabrics.c static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e) · line 602

Quoted 10 lines
fabrics.c +5 -0
@@ -595,6 +595,11 @@ 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;
+

I think this needs to be conditional on if provided at all.

#3 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Quoted 6 lines · Sagi Grimberg
Quoted 6 lines
fabrics.c +0 -0
@@ -595,6 +595,11 @@ static int connect_ctrl(struct
 nvmf_disc_rsp_page_entry *e)
                 return -EINVAL;
             p += len;
 
Quoted 8 lines

fabrics.c static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e) · line 602

Quoted 5 lines
fabrics.c +5 -0
+            len = sprintf(p, ",host_traddr=%s", cfg.host_traddr);
+            if (len < 0)
+                return -EINVAL;
+            p+= len;
+

I think this needs to be conditional on if provided at all.

Also, currently this is implemented for FC but I'll want to add an option for rdma too.
so we'll be able to use it like that:

nvme connect -t rdma -n testsubsystem -a <target_ip> -w <host_ip> -s 1023

in case we want to choose the interface for rdma_resolve_addr. I'll put it on my plate.

Max.

Quoted 4 lines

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer
#4 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Quoted 9 lines

Also, currently this is implemented for FC but I'll want to add an option for rdma too.
so we'll be able to use it like that:

nvme connect -t rdma -n testsubsystem -a <target_ip> -w <host_ip> -s 1023

in case we want to choose the interface for rdma_resolve_addr. I'll put it on my plate.

That would be nice.

#5 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

In reply to Sagi Grimberg

FC requires the host_traddr to make the connection. If it wasn?t provided, the fc transport wouldn?t have been able to connect to the discovery controller and request the disc page. Hence, we wouldn?t be here parsing the response.

Darren Trapp
Senior Director - Engineering
darren.trapp at cavium.com <mailto:darren.trapp at caviumnetworks.com> T 949-389-6273
M 949-212-8576
26650 Aliso Viejo Pkwy, Aliso Viejo, CA 92656 www.qlogic.com <http://www.qlogic.com/>
<http://www.qlogic.com/>

fabrics.c static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e) · line 602

Quoted 9 lines · Linux-nvme on behalf of Sagi Grimberg
fabrics.c +5 -0
@@ -595,6 +595,11 @@ 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;
+

I think this needs to be conditional on if provided at all.

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer
#6 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Quoted 2 lines

FC requires the host_traddr to make the connection. If it wasn?t provided, the fc transport wouldn?t have been able to connect to the discovery controller and request the disc page. Hence, we wouldn?t be here parsing the response.

Did you test this patch with nvme-loop?

#7 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

I have not tried the fc target loopback. But since the discovery response is processed above the fc transport level it should return the same information for the host to process. (ie transport type FC etc).

The connection to the target, from the host perspective, would be the same.

Darren Trapp
Senior Director - Engineering
darren.trapp at cavium.com <mailto:darren.trapp at caviumnetworks.com> T 949-389-6273
M 949-212-8576
26650 Aliso Viejo Pkwy, Aliso Viejo, CA 92656 www.qlogic.com <http://www.qlogic.com/>
<http://www.qlogic.com/>

Quoted 1 line · Sagi Grimberg

FC requires the host_traddr to make the connection. If it wasn?t provided, the fc transport wouldn?t have been able to connect to the discovery controller and request the disc page. Hence, we wouldn?t be here parsing the response.

Did you test this patch with nvme-loop?

maintainer
#8 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Quoted 2 lines

I have not tried the fc target loopback.

After looking at the code again I now recall that the connection string construction is not shared by transports. My concern was that other transports (rdma) won't blow up...

So this looks good,

Reviewed-by Sagi Grimberg <sagi at grimberg.me>
Applied
#9 lore raw

PATCH 1/1 nvme-cli: fabrics: Fix to pass "host_traddr" to the kernel driver.

Quoted 11 lines · Sagi Grimberg
Quoted 2 lines

I have not tried the fc target loopback.

After looking at the code again I now recall that the connection string construction is not shared by transports. My concern was that other transports (rdma) won't blow up...

So this looks good,

Reviewed-by Sagi Grimberg <sagi at grimberg.me>

Thanks, applied the patch with the review.