public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: print the command name of aborted commands
@ 2022-07-18  5:13 Christoph Hellwig
  2022-07-18 20:17 ` Keith Busch
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-07-18  5:13 UTC (permalink / raw)
  To: linux-nvme; +Cc: sagi, kbusch

To allow for slightly better debugging, print the command name when
aborting an command.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index e465902e0b752..1f229dabbe7aa 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1434,8 +1434,10 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
 	cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
 
 	dev_warn(nvmeq->dev->ctrl.device,
-		"I/O %d QID %d timeout, aborting\n",
-		 req->tag, nvmeq->qid);
+		"I/O %d (%s) QID %d timeout, aborting\n",
+		 req->tag,
+		 nvme_get_opcode_str(nvme_req(req)->cmd->common.opcode),
+		 nvmeq->qid);
 
 	abort_req = blk_mq_alloc_request(dev->ctrl.admin_q, nvme_req_op(&cmd),
 					 BLK_MQ_REQ_NOWAIT);
-- 
2.30.2



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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-18  5:13 [PATCH] nvme-pci: print the command name of aborted commands Christoph Hellwig
@ 2022-07-18 20:17 ` Keith Busch
  2022-07-18 21:12 ` Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Keith Busch @ 2022-07-18 20:17 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, sagi

On Mon, Jul 18, 2022 at 07:13:57AM +0200, Christoph Hellwig wrote:
> To allow for slightly better debugging, print the command name when
> aborting an command.

Good idea, looks good.

Reviewed-by: Keith Busch <kbusch@kernel.org>


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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-18  5:13 [PATCH] nvme-pci: print the command name of aborted commands Christoph Hellwig
  2022-07-18 20:17 ` Keith Busch
@ 2022-07-18 21:12 ` Chaitanya Kulkarni
  2022-07-21 22:20 ` Sagi Grimberg
  2022-07-23  6:18 ` Christoph Hellwig
  3 siblings, 0 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-18 21:12 UTC (permalink / raw)
  To: Christoph Hellwig, linux-nvme@lists.infradead.org
  Cc: sagi@grimberg.me, kbusch@kernel.org

On 7/17/22 22:13, Christoph Hellwig wrote:
> To allow for slightly better debugging, print the command name when
> aborting an command.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Definitely useful, looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-18  5:13 [PATCH] nvme-pci: print the command name of aborted commands Christoph Hellwig
  2022-07-18 20:17 ` Keith Busch
  2022-07-18 21:12 ` Chaitanya Kulkarni
@ 2022-07-21 22:20 ` Sagi Grimberg
  2022-07-22  4:37   ` Christoph Hellwig
  2022-07-23  6:18 ` Christoph Hellwig
  3 siblings, 1 reply; 7+ messages in thread
From: Sagi Grimberg @ 2022-07-21 22:20 UTC (permalink / raw)
  To: Christoph Hellwig, linux-nvme; +Cc: kbusch


> To allow for slightly better debugging, print the command name when
> aborting an command.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/nvme/host/pci.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index e465902e0b752..1f229dabbe7aa 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1434,8 +1434,10 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
>   	cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
>   
>   	dev_warn(nvmeq->dev->ctrl.device,
> -		"I/O %d QID %d timeout, aborting\n",
> -		 req->tag, nvmeq->qid);
> +		"I/O %d (%s) QID %d timeout, aborting\n",
> +		 req->tag,
> +		 nvme_get_opcode_str(nvme_req(req)->cmd->common.opcode),
> +		 nvmeq->qid);

I want that for rdma/tcp/loop as well.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-21 22:20 ` Sagi Grimberg
@ 2022-07-22  4:37   ` Christoph Hellwig
  2022-07-24  8:22     ` Sagi Grimberg
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2022-07-22  4:37 UTC (permalink / raw)
  To: Sagi Grimberg; +Cc: Christoph Hellwig, linux-nvme, kbusch

On Fri, Jul 22, 2022 at 01:20:48AM +0300, Sagi Grimberg wrote:
> I want that for rdma/tcp/loop as well.

We don't ever send an abort from those currently.


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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-18  5:13 [PATCH] nvme-pci: print the command name of aborted commands Christoph Hellwig
                   ` (2 preceding siblings ...)
  2022-07-21 22:20 ` Sagi Grimberg
@ 2022-07-23  6:18 ` Christoph Hellwig
  3 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-07-23  6:18 UTC (permalink / raw)
  To: linux-nvme; +Cc: sagi, kbusch

We'll need to fold this in to fix the modular build:

diff --git a/drivers/nvme/host/constants.c b/drivers/nvme/host/constants.c
index 6973c2a17c13d..e958d50155857 100644
--- a/drivers/nvme/host/constants.c
+++ b/drivers/nvme/host/constants.c
@@ -177,6 +177,7 @@ const unsigned char *nvme_get_opcode_str(u8 opcode)
 		return nvme_ops[opcode];
 	return "Unknown";
 }
+EXPORT_SYMBOL_GPL(nvme_get_opcode_str);
 
 const unsigned char *nvme_get_admin_opcode_str(u8 opcode)
 {


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

* Re: [PATCH] nvme-pci: print the command name of aborted commands
  2022-07-22  4:37   ` Christoph Hellwig
@ 2022-07-24  8:22     ` Sagi Grimberg
  0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2022-07-24  8:22 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, kbusch


>> I want that for rdma/tcp/loop as well.
> 
> We don't ever send an abort from those currently.

I meant on timedout requests.


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

end of thread, other threads:[~2022-07-24  8:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-18  5:13 [PATCH] nvme-pci: print the command name of aborted commands Christoph Hellwig
2022-07-18 20:17 ` Keith Busch
2022-07-18 21:12 ` Chaitanya Kulkarni
2022-07-21 22:20 ` Sagi Grimberg
2022-07-22  4:37   ` Christoph Hellwig
2022-07-24  8:22     ` Sagi Grimberg
2022-07-23  6:18 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox