Skip to contentSkip to conversation

nvme-fc: Add message when creating new controller

PATCH New James Smart 5 participants 7 messages May 28, 2019 – May 29, 2019

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

PATCH 1/1 nvme-fc: Add message when creating new controller

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>
---
 drivers/nvme/host/fc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/nvme/host/fc.c +4 -0
index c17c887f2148..5c9b69ee2c1f 100644
@@ -3129,6 +3129,10 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 
 	nvme_get_ctrl(&ctrl->ctrl);
 
+	dev_info(ctrl->ctrl.device,
+		"NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n",
+		ctrl->cnum, ctrl->ctrl.opts->subsysnqn);
+
 	if (!queue_delayed_work(nvme_wq, &ctrl->connect_work, 0)) {
 		nvme_put_ctrl(&ctrl->ctrl);
 		dev_err(ctrl->ctrl.device,
Signature · 1 line
2.13.7
#1 lore raw

PATCH 1/1 nvme-fc: Add message when creating new controller

Looks good.

Reviewed-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
Quoted 30 lines · James Smart

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>
---
  drivers/nvme/host/fc.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/nvme/host/fc.c +4 -0
index c17c887f2148..5c9b69ee2c1f 100644
@@ -3129,6 +3129,10 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 
  	nvme_get_ctrl(&ctrl->ctrl);
 
+	dev_info(ctrl->ctrl.device,
+		"NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n",
+		ctrl->cnum, ctrl->ctrl.opts->subsysnqn);
+
  	if (!queue_delayed_work(nvme_wq, &ctrl->connect_work, 0)) {
  		nvme_put_ctrl(&ctrl->ctrl);
  		dev_err(ctrl->ctrl.device,
#2 lore raw

PATCH 1/1 nvme-fc: Add message when creating new controller

In reply to James Smart
Quoted 19 lines · James Smart

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>
---
 drivers/nvme/host/fc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/nvme/host/fc.c +0 -0
index c17c887f2148..5c9b69ee2c1f 100644

drivers/nvme/host/fc.c nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · line 3135

Quoted 7 lines
drivers/nvme/host/fc.c +4 -0
@@ -3129,6 +3129,10 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 
 	nvme_get_ctrl(&ctrl->ctrl);
 
+	dev_info(ctrl->ctrl.device,
+		"NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n",
+		ctrl->cnum, ctrl->ctrl.opts->subsysnqn);
+

Adding rport+lport information would be helpful. It would be good to have for all messages, but at least one message establishing the relationship would make it easier when looking at logs.

Just wondering if there is any reason why no FC rport/lport info was logged with any of the messages in fc.c?

Regards,
-Arun

Quoted 4 lines
drivers/nvme/host/fc.c +0 -0
 	if (!queue_delayed_work(nvme_wq, &ctrl->connect_work, 0)) {
 		nvme_put_ctrl(&ctrl->ctrl);
 		dev_err(ctrl->ctrl.device,
#3 lore raw

PATCH 1/1 nvme-fc: Add message when creating new controller

Quoted 26 lines · Arun Easi
Quoted 15 lines · James Smart

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>
---
  drivers/nvme/host/fc.c | 4 ++++
  1 file changed, 4 insertions(+)

drivers/nvme/host/fc.c nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · line 3135

Quoted 4 lines
drivers/nvme/host/fc.c +4 -0
+	dev_info(ctrl->ctrl.device,
+		"NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n",
+		ctrl->cnum, ctrl->ctrl.opts->subsysnqn);
+

Adding rport+lport information would be helpful. It would be good to have for all messages, but at least one message establishing the relationship would make it easier when looking at logs.

Quoted 2 lines

Just wondering if there is any reason why no FC rport/lport info was logged with any of the messages in fc.c?

I actually asked myself the same question after sending the patch:
whether having host_traddr and traddr fields in that message made sense. I opted to stay as is only because it is much shorter (those WWN's are long).

The other question I had is whether I should print this only on initial creation or whenever a new association is started so it picks up the cases of when a reconnect start. Only disadvantage is - more long messages in the log.

I can easily be convinced to do something different if you prefer.

-- james

#4 lore raw
Quoted 28 lines · James Smart

----------------------------------------------------------------------

Quoted 26 lines · Arun Easi
Quoted 15 lines · James Smart

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>
---
  drivers/nvme/host/fc.c | 4 ++++
  1 file changed, 4 insertions(+)

drivers/nvme/host/fc.c nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · line 3135

Quoted 4 lines
drivers/nvme/host/fc.c +4 -0
+	dev_info(ctrl->ctrl.device,
+		"NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n",
+		ctrl->cnum, ctrl->ctrl.opts->subsysnqn);
+

Adding rport+lport information would be helpful. It would be good to have for all messages, but at least one message establishing the relationship would make it easier when looking at logs.

Quoted 6 lines
Quoted 2 lines

Just wondering if there is any reason why no FC rport/lport info was logged with any of the messages in fc.c?

I actually asked myself the same question after sending the patch: whether having host_traddr and traddr fields in that message made sense. I opted to stay as is only because it is much shorter (those WWN's are long).

I agree, *traaddr-s are too long. Having just lport pWWN and rport pWWN, though still longer, would be good IMHO. Longer term, it would be great to have a nvmefc_info/warn/err that takes in a "ctrl" or other abstraction that can provide these additional information. That way messages remain consistent and easily changeable to usefulness/taste.

Quoted 4 lines

The other question I had is whether I should print this only on initial creation or whenever a new association is started so it picks up the cases of when a reconnect start.

+1 for reconnect. That way we can know every start of re-connects.

-- arun

Quoted 7 lines

Only disadvantage is - more long messages in the log.

I can easily be convinced to do something different if you prefer.

-- james

#5 lore raw

PATCH 1/1 nvme-fc: Add message when creating new controller

In reply to James Smart
Quoted 35 lines · James Smart
Quoted 22 lines · Arun Easi
Quoted 15 lines · James Smart

When looking at console messages to troubleshoot, there are one maybe two messages before creation of the controller is complete. However, a lot of io takes place to reach that point. It's unclear when things have started.

Add a message when the controller is first attempting to be connecting to. Thus we know what controller and its NQN is being put into place for any subsequent success or failure messages.

Signed-off-by James Smart <jsmart2021 at gmail.com>

---
? drivers/nvme/host/fc.c | 4 ++++
? 1 file changed, 4 insertions(+)

Quoted 4 lines

+??? dev_info(ctrl->ctrl.device,
+??????? "NVME-FC{%d}: creating new ctrl: NQN \"%s\"\n", +??????? ctrl->cnum, ctrl->ctrl.opts->subsysnqn); +

Quoted 6 lines

Adding rport+lport information would be helpful. It would be good to have for all messages, but at least one message establishing the relationship would make it easier when looking at logs.

Just wondering if there is any reason why no FC rport/lport info was logged with any of the messages in fc.c?

I actually asked myself the same question after sending the patch:
whether having host_traddr and traddr fields in that message made sense. I opted to stay as is only because it is much shorter (those WWN's are long).

Quoted 6 lines

The other question I had is whether I should print this only on initial creation or whenever a new association is started so it picks up the cases of when a reconnect start.? Only disadvantage is - more long messages in the log.

I can easily be convinced to do something different if you prefer.

I favor verbose messaging

Quoted 9 lines

-- james

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.org_mailman_listinfo_linux-2Dnvme&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=t2fPg9D87F7D8jm0_3CG9yoiIKdRg4qc_thBw4bzMhc&m=-tvfUIdJvX11XRrXVMd9syTIrIoJAFnwJP68H6ECzHw&s=D4NF6jMTh4KtdGzFq_DoNfKrJPM_nQg2IDqnG-3f3xQ&e=

Signature · 2 lines
Thank You,
John