nvme-rdma: enhance timeout kernel log
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Sun, 7 Jan 2024 00:29:49 +0000 (02:29 +0200)
committerKeith Busch <kbusch@kernel.org>
Mon, 8 Jan 2024 18:09:45 +0000 (10:09 -0800)
Print the command_id along side blk-mq's tag to help match commands with
protocol wire traces and logs.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/rdma.c

index bc90ec3c51b078952e8a118b0868471616f844f3..2e77c0f25f710e7ad19ea2c99496961a93b0b0a3 100644 (file)
@@ -1941,9 +1941,14 @@ static enum blk_eh_timer_return nvme_rdma_timeout(struct request *rq)
        struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
        struct nvme_rdma_queue *queue = req->queue;
        struct nvme_rdma_ctrl *ctrl = queue->ctrl;
-
-       dev_warn(ctrl->ctrl.device, "I/O %d QID %d timeout\n",
-                rq->tag, nvme_rdma_queue_idx(queue));
+       u8 opcode = req->req.cmd->common.opcode;
+       u8 fctype = req->req.cmd->fabrics.fctype;
+       int qid = nvme_rdma_queue_idx(queue);
+
+       dev_warn(ctrl->ctrl.device,
+                "I/O tag %d (%04x) opcode %#x (%s) QID %d timeout\n",
+                rq->tag, nvme_cid(rq), opcode,
+                nvme_opcode_str(qid, opcode, fctype), qid);
 
        if (ctrl->ctrl.state != NVME_CTRL_LIVE) {
                /*