nvme-pci: print the command name of aborted commands
Christoph Hellwig
maintainerPATCH 1/1 nvme-pci: print the command name of aborted commands
To allow for slightly better debugging, print the command name when aborting an command.
--- drivers/nvme/host/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +4 -2
@@ -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 );
Signature · 1 line
2.30.2
Quoted 2 lines · Christoph Hellwig
To allow for slightly better debugging, print the command name when aborting an command.
Good idea, looks good.
Quoted 5 lines · Christoph Hellwig
To allow for slightly better debugging, print the command name when aborting an command.
Signed-off-by Christoph Hellwig <[email protected]>---
Definitely useful, looks good.
-ck
Quoted 14 lines
To allow for slightly better debugging, print the command name when aborting an command.
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/nvme/host/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/nvme/host/pci.c +0
-0
drivers/nvme/host/pci.c static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) · line 1440
Quoted 9 lines
drivers/nvme/host/pci.c +4
-2@@ -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.
Christoph Hellwig
maintainerQuoted 1 line · Sagi Grimberg
I want that for rdma/tcp/loop as well.
We don't ever send an abort from those currently.
Sagi Grimberg
maintainerQuoted 4 lines
Quoted 2 lines
I want that for rdma/tcp/loop as well.
We don't ever send an abort from those currently.
I meant on timedout requests.
Christoph Hellwig
maintainerWe'll need to fold this in to fix the modular build:
drivers/nvme/host/constants.c +1 -0
@@ -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) {