Skip to content

Commit 0d150be

Browse files
calebsanderkeithbusch
authored andcommitted
nvme-fc: log human-readable opcode on timeout
The fc transport logs the opcode and fctype on command timeout. This is sufficient information to identify the command issued, but not very human-readable. Use the nvme_fabrics_opcode_str() helper to also log the name of the command, as rdma and tcp already do. Signed-off-by: Caleb Sander <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 7d23e83 commit 0d150be

File tree

1 file changed

+5
-3
lines changed
  • drivers/nvme/host

1 file changed

+5
-3
lines changed

drivers/nvme/host/fc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,7 @@ static enum blk_eh_timer_return nvme_fc_timeout(struct request *rq)
25742574
{
25752575
struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq);
25762576
struct nvme_fc_ctrl *ctrl = op->ctrl;
2577+
u16 qnum = op->queue->qnum;
25772578
struct nvme_fc_cmd_iu *cmdiu = &op->cmd_iu;
25782579
struct nvme_command *sqe = &cmdiu->sqe;
25792580

@@ -2582,10 +2583,11 @@ static enum blk_eh_timer_return nvme_fc_timeout(struct request *rq)
25822583
* will detect the aborted io and will fail the connection.
25832584
*/
25842585
dev_info(ctrl->ctrl.device,
2585-
"NVME-FC{%d.%d}: io timeout: opcode %d fctype %d w10/11: "
2586+
"NVME-FC{%d.%d}: io timeout: opcode %d fctype %d (%s) w10/11: "
25862587
"x%08x/x%08x\n",
2587-
ctrl->cnum, op->queue->qnum, sqe->common.opcode,
2588-
sqe->connect.fctype, sqe->common.cdw10, sqe->common.cdw11);
2588+
ctrl->cnum, qnum, sqe->common.opcode, sqe->fabrics.fctype,
2589+
nvme_fabrics_opcode_str(qnum, sqe),
2590+
sqe->common.cdw10, sqe->common.cdw11);
25892591
if (__nvme_fc_abort_op(ctrl, op))
25902592
nvme_fc_error_recovery(ctrl, "io timeout abort failed");
25912593

0 commit comments

Comments
 (0)