Skip to contentSkip to conversation

nvme-tcp: show hostnqn when connecting to tcp target

PATCH Applied Nitin U. Yewale 4 participants 13 messages Jan 29, 2024 – Feb 1, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 nvme-tcp: show hostnqn when connecting to tcp target

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
 drivers/nvme/host/tcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +2 -2
index d058d990532b..5eb53c2566d8 100644
@@ -2753,8 +2753,8 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev,
 	if (ret)
 		goto out_uninit_ctrl;
 
-	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISp\n",
-		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr);
+	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISp, hostnqn: %s\n",
+		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr, opts->host->nqn);
 
 	mutex_lock(&nvme_tcp_ctrl_mutex);
 	list_add_tail(&ctrl->list, &nvme_tcp_ctrl_list);
Signature · 1 line
2.39.3
#1 lore raw

PATCH v2 2/3 nvme-rdma: show hostnqn when connecting to rdma target

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
 drivers/nvme/host/rdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/rdma.c +2 -2
index 11dde0d83044..60f42c959acb 100644
@@ -2296,8 +2296,8 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
 	if (ret)
 		goto out_uninit_ctrl;
 
-	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISpcs\n",
-		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr);
+	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISpcs, hostnqn: %s\n",
+		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr, opts->host->nqn);
 
 	mutex_lock(&nvme_rdma_ctrl_mutex);
 	list_add_tail(&ctrl->list, &nvme_rdma_ctrl_list);
Signature · 1 line
2.39.3
Reviewed-by on v2 2/3
#2 lore raw

Re: [PATCHv2 2/3] nvme-rdma: show hostnqn when connecting to rdma target

Quoted 24 lines · Nitin U. Yewale

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
  drivers/nvme/host/rdma.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/rdma.c +2 -2
index 11dde0d83044..60f42c959acb 100644
@@ -2296,8 +2296,8 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
  	if (ret)
  		goto out_uninit_ctrl;
 
-	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISpcs\n",
-		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr);
+	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISpcs, hostnqn: %s\n",
+		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr, opts->host->nqn);
 
  	mutex_lock(&nvme_rdma_ctrl_mutex);
  	list_add_tail(&ctrl->list, &nvme_rdma_ctrl_list);
#4 lore raw

PATCH v2 3/3 nvme-fc: show hostnqn when connecting to fc target

In reply to Nitin U. Yewale

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
 drivers/nvme/host/fc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +2 -2
index 16847a316421..7ac565b0f13b 100644
@@ -3575,8 +3575,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 	flush_delayed_work(&ctrl->connect_work);
 
 	dev_info(ctrl->ctrl.device,
-		"NVME-FC{%d}: new ctrl: NQN \"%s\"\n",
-		ctrl->cnum, nvmf_ctrl_subsysnqn(&ctrl->ctrl));
+		"NVME-FC{%d}: new ctrl: NQN \"%s\", hostnqn: %s\n",
+		ctrl->cnum, nvmf_ctrl_subsysnqn(&ctrl->ctrl), opts->host->nqn);
 
 	return &ctrl->ctrl;
 
Signature · 1 line
2.39.3
Reviewed-by on v2 3/3
#5 lore raw

Re: [PATCHv2 3/3] nvme-fc: show hostnqn when connecting to fc target

Quoted 24 lines · Nitin U. Yewale

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
  drivers/nvme/host/fc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +2 -2
index 16847a316421..7ac565b0f13b 100644
@@ -3575,8 +3575,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
  	flush_delayed_work(&ctrl->connect_work);
 
  	dev_info(ctrl->ctrl.device,
-		"NVME-FC{%d}: new ctrl: NQN \"%s\"\n",
-		ctrl->cnum, nvmf_ctrl_subsysnqn(&ctrl->ctrl));
+		"NVME-FC{%d}: new ctrl: NQN \"%s\", hostnqn: %s\n",
+		ctrl->cnum, nvmf_ctrl_subsysnqn(&ctrl->ctrl), opts->host->nqn);
 
  	return &ctrl->ctrl;
 
maintainer
#7 lore raw
In reply to Nitin U. Yewale
Quoted 4 lines

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

hostnqn is available via sysfs, why do we need to log it?

maintainer
#8 lore raw
Quoted 6 lines · Sagi Grimberg
Quoted 4 lines

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

hostnqn is available via sysfs, why do we need to log it?

I personally haven't encountered an issue where these patches would have helped, but sometimes a dmesg is all you get with a bug report.

Reviewed-by
#9 lore raw
Quoted 10 lines · Keith Busch
Quoted 6 lines · Sagi Grimberg
Quoted 4 lines

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

hostnqn is available via sysfs, why do we need to log it?

I personally haven't encountered an issue where these patches would have helped, but sometimes a dmesg is all you get with a bug report.

Yes, exactly. dmesg is the first place people look and often times it's the only thing available.

maintainer Reviewed-by
#10 lore raw
Quoted 8 lines · John Meneghini
Quoted 6 lines · Keith Busch
Quoted 5 lines · Sagi Grimberg
Quoted 4 lines

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

hostnqn is available via sysfs, why do we need to log it?

I personally haven't encountered an issue where these patches would have helped, but sometimes a dmesg is all you get with a bug report.

Yes, exactly. dmesg is the first place people look and often times it's the only thing available.

Its going to create overly long log lines... but if you find it useful I'm fine with it.

Quoted 2 lines
Reviewed-by on v2 1/3
#11 lore raw
In reply to Nitin U. Yewale
Quoted 24 lines · Nitin U. Yewale

Log hostnqn when connecting to nvme target.
As hostnqn could be changed, logging this information in syslog at appropriate time may help in troubleshooting.

---
  drivers/nvme/host/tcp.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +2 -2
index d058d990532b..5eb53c2566d8 100644
@@ -2753,8 +2753,8 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev,
  	if (ret)
  		goto out_uninit_ctrl;
 
-	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISp\n",
-		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr);
+	dev_info(ctrl->ctrl.device, "new ctrl: NQN \"%s\", addr %pISp, hostnqn: %s\n",
+		nvmf_ctrl_subsysnqn(&ctrl->ctrl), &ctrl->addr, opts->host->nqn);
 
  	mutex_lock(&nvme_tcp_ctrl_mutex);
  	list_add_tail(&ctrl->list, &nvme_tcp_ctrl_list);