Skip to content

Commit e999ef1

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Cancel ELS WQE instead of issuing abort when SLI port is inactive
During SLI port errata events, there should be no expectation that submitted outstanding WQEs will return back CQEs. In these situations, the driver should not rely on receiving CQEs from the SLI port to signal WQE resource clean up. Put an sli_flag LPFC_SLI_ACTIVE check in lpfc_els_flush_cmd() when walking the txcmplq. The sli_flag check helps determine whether to issue an abort or driver based cancel on outstanding WQEs. If !LPFC_SLI_ACTIVE, then there's no point to issue anything to the SLI port. Instead, let the driver based cancel logic clean up the submitted WQE resources. Also, enhance some abort log messages that help with future debugging. Signed-off-by: Justin Tee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1613e60 commit e999ef1

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9665,7 +9665,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96659665
list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) {
96669666
spin_lock_irqsave(&phba->hbalock, iflags);
96679667
list_del_init(&piocb->dlist);
9668-
if (mbx_tmo_err)
9668+
if (mbx_tmo_err || !(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
96699669
list_move_tail(&piocb->list, &cancel_list);
96709670
else
96719671
lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL);

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12301,18 +12301,16 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1230112301
goto release_iocb;
1230212302
}
1230312303
}
12304-
12305-
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_SLI,
12306-
"0327 Cannot abort els iocb x%px "
12307-
"with io cmd xri %x abort tag : x%x, "
12308-
"abort status %x abort code %x\n",
12309-
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
12310-
(phba->sli_rev == LPFC_SLI_REV4) ?
12311-
get_wqe_reqtag(cmdiocb) :
12312-
cmdiocb->iocb.un.acxri.abortContextTag,
12313-
ulp_status, ulp_word4);
12314-
1231512304
}
12305+
12306+
lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI,
12307+
"0327 Abort els iocb complete x%px with io cmd xri %x "
12308+
"abort tag x%x abort status %x abort code %x\n",
12309+
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
12310+
(phba->sli_rev == LPFC_SLI_REV4) ?
12311+
get_wqe_reqtag(cmdiocb) :
12312+
cmdiocb->iocb.ulpIoTag,
12313+
ulp_status, ulp_word4);
1231612314
release_iocb:
1231712315
lpfc_sli_release_iocbq(phba, cmdiocb);
1231812316
return;
@@ -12509,10 +12507,10 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
1250912507
lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
1251012508
"0339 Abort IO XRI x%x, Original iotag x%x, "
1251112509
"abort tag x%x Cmdjob : x%px Abortjob : x%px "
12512-
"retval x%x : IA %d\n",
12510+
"retval x%x : IA %d cmd_cmpl %ps\n",
1251312511
ulp_context, (phba->sli_rev == LPFC_SLI_REV4) ?
1251412512
cmdiocb->iotag : iotag, iotag, cmdiocb, abtsiocbp,
12515-
retval, ia);
12513+
retval, ia, abtsiocbp->cmd_cmpl);
1251612514
if (retval) {
1251712515
cmdiocb->cmd_flag &= ~LPFC_DRIVER_ABORTED;
1251812516
__lpfc_sli_release_iocbq(phba, abtsiocbp);

0 commit comments

Comments
 (0)