Skip to content

Commit ea7bd1f

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: Add more logging of cmd and cqe information for aborted NVMe cmds
When an NVMe command is aborted or completes with an ERSP, log the opcode and command ID fields to help provide more detail on the failed command. Link: https://lore.kernel.org/r/[email protected] Co-developed-by: Justin Tee <[email protected]> Signed-off-by: Justin Tee <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 336d636 commit ea7bd1f

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

drivers/scsi/lpfc/lpfc_nvme.c

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,25 +1065,37 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
10651065
nCmd->rcv_rsplen = wcqe->parameter;
10661066
nCmd->status = 0;
10671067

1068+
/* Get the NVME cmd details for this unique error. */
1069+
cp = (struct nvme_fc_cmd_iu *)nCmd->cmdaddr;
1070+
ep = (struct nvme_fc_ersp_iu *)nCmd->rspaddr;
1071+
10681072
/* Check if this is really an ERSP */
10691073
if (nCmd->rcv_rsplen == LPFC_NVME_ERSP_LEN) {
10701074
lpfc_ncmd->status = IOSTAT_SUCCESS;
10711075
lpfc_ncmd->result = 0;
10721076

10731077
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME,
1074-
"6084 NVME Completion ERSP: "
1075-
"xri %x placed x%x\n",
1076-
lpfc_ncmd->cur_iocbq.sli4_xritag,
1077-
wcqe->total_data_placed);
1078+
"6084 NVME FCP_ERR ERSP: "
1079+
"xri %x placed x%x opcode x%x cmd_id "
1080+
"x%x cqe_status x%x\n",
1081+
lpfc_ncmd->cur_iocbq.sli4_xritag,
1082+
wcqe->total_data_placed,
1083+
cp->sqe.common.opcode,
1084+
cp->sqe.common.command_id,
1085+
ep->cqe.status);
10781086
break;
10791087
}
10801088
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
10811089
"6081 NVME Completion Protocol Error: "
10821090
"xri %x status x%x result x%x "
1083-
"placed x%x\n",
1091+
"placed x%x opcode x%x cmd_id x%x, "
1092+
"cqe_status x%x\n",
10841093
lpfc_ncmd->cur_iocbq.sli4_xritag,
10851094
lpfc_ncmd->status, lpfc_ncmd->result,
1086-
wcqe->total_data_placed);
1095+
wcqe->total_data_placed,
1096+
cp->sqe.common.opcode,
1097+
cp->sqe.common.command_id,
1098+
ep->cqe.status);
10871099
break;
10881100
case IOSTAT_LOCAL_REJECT:
10891101
/* Let fall through to set command final state. */
@@ -1842,6 +1854,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
18421854
struct lpfc_nvme_fcpreq_priv *freqpriv;
18431855
unsigned long flags;
18441856
int ret_val;
1857+
struct nvme_fc_cmd_iu *cp;
18451858

18461859
/* Validate pointers. LLDD fault handling with transport does
18471860
* have timing races.
@@ -1965,10 +1978,16 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
19651978
return;
19661979
}
19671980

1981+
/*
1982+
* Get Command Id from cmd to plug into response. This
1983+
* code is not needed in the next NVME Transport drop.
1984+
*/
1985+
cp = (struct nvme_fc_cmd_iu *)lpfc_nbuf->nvmeCmd->cmdaddr;
19681986
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_ABTS,
19691987
"6138 Transport Abort NVME Request Issued for "
1970-
"ox_id x%x\n",
1971-
nvmereq_wqe->sli4_xritag);
1988+
"ox_id x%x nvme opcode x%x nvme cmd_id x%x\n",
1989+
nvmereq_wqe->sli4_xritag, cp->sqe.common.opcode,
1990+
cp->sqe.common.command_id);
19721991
return;
19731992

19741993
out_unlock:

0 commit comments

Comments
 (0)