linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] nvme: Improve warnings for scan_work
@ 2020-11-30 12:47 Minwoo Im
  2020-11-30 12:47 ` [PATCH 1/2] nvme: elaborate ns-descs failure warning in detail Minwoo Im
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Minwoo Im @ 2020-11-30 12:47 UTC (permalink / raw)
  To: linux-nvme
  Cc: Keith Busch, Jens Axboe, Minwoo Im, Christoph Hellwig,
	Sagi Grimberg

These two patches improve warning logs when identify commands fail
during the scan_work.

Please have a look.

Minwoo Im (2):
  nvme: elaborate ns-descs failure warning in detail
  nvme: Print warning for list-ns command failure

 drivers/nvme/host/core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

-- 
2.17.1


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

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

* [PATCH 1/2] nvme: elaborate ns-descs failure warning in detail
  2020-11-30 12:47 [PATCH 0/2] nvme: Improve warnings for scan_work Minwoo Im
@ 2020-11-30 12:47 ` Minwoo Im
  2020-11-30 12:47 ` [PATCH 2/2] nvme: Print warning for list-ns command failure Minwoo Im
  2020-12-01 19:23 ` [PATCH 0/2] nvme: Improve warnings for scan_work Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Minwoo Im @ 2020-11-30 12:47 UTC (permalink / raw)
  To: linux-nvme
  Cc: Keith Busch, Jens Axboe, Minwoo Im, Christoph Hellwig,
	Sagi Grimberg

Add nsid to figure out which namespace id has been failed during
ns-descs commands.  If we don't print it out, some of duplicated
warnings which don't have much meaningful statement can be seen
like:

[    1.321031] nvme nvme0: Identify Descriptors failed (16386)
[    1.321948] nvme nvme0: Identify Descriptors failed (16386)
[    1.322872] nvme nvme0: Identify Descriptors failed (16386)
[    1.323775] nvme nvme0: Identify Descriptors failed (16386)
[    1.324687] nvme nvme0: Identify Descriptors failed (16386)
...

Also, this patch prints status value in hexadecimal format rather
than decimal for better readability.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f42ed266bd7f..ded6376facbe 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1357,7 +1357,8 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
 				      NVME_IDENTIFY_DATA_SIZE);
 	if (status) {
 		dev_warn(ctrl->device,
-			"Identify Descriptors failed (%d)\n", status);
+			"Identify Descriptors failed (nsid=%u, status=0x%x)\n",
+			nsid, status);
 		goto free_data;
 	}
 
-- 
2.17.1


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

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

* [PATCH 2/2] nvme: Print warning for list-ns command failure
  2020-11-30 12:47 [PATCH 0/2] nvme: Improve warnings for scan_work Minwoo Im
  2020-11-30 12:47 ` [PATCH 1/2] nvme: elaborate ns-descs failure warning in detail Minwoo Im
@ 2020-11-30 12:47 ` Minwoo Im
  2020-12-01 19:23 ` [PATCH 0/2] nvme: Improve warnings for scan_work Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Minwoo Im @ 2020-11-30 12:47 UTC (permalink / raw)
  To: linux-nvme
  Cc: Keith Busch, Jens Axboe, Minwoo Im, Christoph Hellwig,
	Sagi Grimberg

During the scan_work, list-ns command is issued to figure out which
namespaces are in active state.  But if this command is failed, it will
try to scan namespaces sequentially.  In this situation, we don't see
any warnings and don't even know whether list-ns command has been failed
or not easiliy.

This patch prints out warning for the failure of the list-ns command.
Then we can find easily what's going on in the scan_work like:

[    1.108399] nvme nvme0: Identify NS List failed (status=0x400b)
[    1.109583] nvme0n1: detected capacity change from 0 to 1048576
[    1.112186] nvme nvme0: Identify Descriptors failed (nsid=2, status=0x4002)
[    1.113929] nvme nvme0: Identify Descriptors failed (nsid=3, status=0x4002)
[    1.116537] nvme nvme0: Identify Descriptors failed (nsid=4, status=0x4002)
...

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
 drivers/nvme/host/core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index ded6376facbe..64905bc83e9d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4096,8 +4096,12 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
 
 		ret = nvme_submit_sync_cmd(ctrl->admin_q, &cmd, ns_list,
 					    NVME_IDENTIFY_DATA_SIZE);
-		if (ret)
+		if (ret) {
+			dev_warn(ctrl->device,
+				"Identify NS List failed (status=0x%x)\n",
+				ret);
 			goto free;
+		}
 
 		for (i = 0; i < nr_entries; i++) {
 			u32 nsid = le32_to_cpu(ns_list[i]);
-- 
2.17.1


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

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

* Re: [PATCH 0/2] nvme: Improve warnings for scan_work
  2020-11-30 12:47 [PATCH 0/2] nvme: Improve warnings for scan_work Minwoo Im
  2020-11-30 12:47 ` [PATCH 1/2] nvme: elaborate ns-descs failure warning in detail Minwoo Im
  2020-11-30 12:47 ` [PATCH 2/2] nvme: Print warning for list-ns command failure Minwoo Im
@ 2020-12-01 19:23 ` Christoph Hellwig
  2020-12-02 10:06   ` Minwoo Im
  2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2020-12-01 19:23 UTC (permalink / raw)
  To: Minwoo Im
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, linux-nvme,
	Sagi Grimberg

Thanks,

applied to nvme-5.11.

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

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

* Re: [PATCH 0/2] nvme: Improve warnings for scan_work
  2020-12-01 19:23 ` [PATCH 0/2] nvme: Improve warnings for scan_work Christoph Hellwig
@ 2020-12-02 10:06   ` Minwoo Im
  0 siblings, 0 replies; 5+ messages in thread
From: Minwoo Im @ 2020-12-02 10:06 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Jens Axboe, Sagi Grimberg, linux-nvme

Hello,

On 20-12-01 20:23:38, Christoph Hellwig wrote:
> Thanks,
> 
> applied to nvme-5.11.

Thank you Christoph to update commit descriptions wordings.  I will keep
that in mind not to use abbreivation for things like commands.

Thanks,

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

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

end of thread, other threads:[~2020-12-02 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30 12:47 [PATCH 0/2] nvme: Improve warnings for scan_work Minwoo Im
2020-11-30 12:47 ` [PATCH 1/2] nvme: elaborate ns-descs failure warning in detail Minwoo Im
2020-11-30 12:47 ` [PATCH 2/2] nvme: Print warning for list-ns command failure Minwoo Im
2020-12-01 19:23 ` [PATCH 0/2] nvme: Improve warnings for scan_work Christoph Hellwig
2020-12-02 10:06   ` Minwoo Im

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).