Skip to content

Commit 31a59f7

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: SLI path split: Refactor Abort paths
This patch refactors the Abort paths to use SLI-4 as the primary interface. - Introduce generic lpfc_sli_prep_abort_xri jump table routine - Consolidate lpfc_sli4_issue_abort_iotag and lpfc_sli_issue_abort_iotag into a single generic lpfc_sli_issue_abort_iotag routine - Consolidate lpfc_sli4_abort_fcp_cmpl and lpfc_sli_abort_fcp_cmpl into a single generic lpfc_sli_abort_fcp_cmpl routine - Remove unused routine lpfc_get_iocb_from_iocbq - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-15-jsmart2021@gmail.com Co-developed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 3512ac0 commit 31a59f7

6 files changed

Lines changed: 236 additions & 184 deletions

File tree

drivers/scsi/lpfc/lpfc.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,6 @@ struct lpfc_hba {
931931
void (*__lpfc_sli_release_iocbq)(struct lpfc_hba *,
932932
struct lpfc_iocbq *);
933933
int (*lpfc_hba_down_post)(struct lpfc_hba *phba);
934-
IOCB_t * (*lpfc_get_iocb_from_iocbq)
935-
(struct lpfc_iocbq *);
936934
void (*lpfc_scsi_cmd_iocb_cmpl)
937935
(struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *);
938936

@@ -979,6 +977,9 @@ struct lpfc_hba {
979977
struct lpfc_dmabuf *bmp, u16 rpi,
980978
u16 ox_id, u32 num_entry, u8 rctl,
981979
u8 last_seq, u8 cr_cx_cmd);
980+
void (*__lpfc_sli_prep_abort_xri)(struct lpfc_iocbq *cmdiocbq,
981+
u16 ulp_context, u16 iotag,
982+
u8 ulp_class, u16 cqid, bool ia);
982983

983984
/* expedite pool */
984985
struct lpfc_epd_pool epd_pool;
@@ -1869,6 +1870,15 @@ u32 get_job_data_placed(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
18691870
return iocbq->iocb.un.genreq64.bdl.bdeSize;
18701871
}
18711872

1873+
static inline
1874+
u32 get_job_abtsiotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
1875+
{
1876+
if (phba->sli_rev == LPFC_SLI_REV4)
1877+
return iocbq->wqe.abort_cmd.wqe_com.abort_tag;
1878+
else
1879+
return iocbq->iocb.un.acxri.abortIoTag;
1880+
}
1881+
18721882
static inline
18731883
u32 get_job_els_rsp64_did(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
18741884
{

drivers/scsi/lpfc/lpfc_crtn.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ void lpfc_sli_prep_xmit_seq64(struct lpfc_hba *phba,
366366
struct lpfc_dmabuf *bmp, u16 rpi, u16 ox_id,
367367
u32 num_entry, u8 rctl, u8 last_seq,
368368
u8 cr_cx_cmd);
369+
void lpfc_sli_prep_abort_xri(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocbq,
370+
u16 ulp_context, u16 iotag, u8 ulp_class, u16 cqid,
371+
bool ia);
369372
struct lpfc_sglq *__lpfc_clear_active_sglq(struct lpfc_hba *phba, uint16_t xri);
370373
struct lpfc_sglq *__lpfc_sli_get_nvmet_sglq(struct lpfc_hba *phba,
371374
struct lpfc_iocbq *piocbq);

drivers/scsi/lpfc/lpfc_nvme.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,9 +1746,8 @@ lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
17461746
"6145 ABORT_XRI_CN completing on rpi x%x "
17471747
"original iotag x%x, abort cmd iotag x%x "
17481748
"req_tag x%x, status x%x, hwstatus x%x\n",
1749-
cmdiocb->iocb.un.acxri.abortContextTag,
1750-
cmdiocb->iocb.un.acxri.abortIoTag,
1751-
cmdiocb->iotag,
1749+
bf_get(wqe_ctxt_tag, &cmdiocb->wqe.generic.wqe_com),
1750+
get_job_abtsiotag(phba, cmdiocb), cmdiocb->iotag,
17521751
bf_get(lpfc_wcqe_c_request_tag, abts_cmpl),
17531752
bf_get(lpfc_wcqe_c_status, abts_cmpl),
17541753
bf_get(lpfc_wcqe_c_hw_status, abts_cmpl));

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5929,15 +5929,13 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
59295929
}
59305930

59315931
lpfc_cmd->waitq = &waitq;
5932-
if (phba->sli_rev == LPFC_SLI_REV4) {
5932+
if (phba->sli_rev == LPFC_SLI_REV4)
59335933
spin_unlock(&pring_s4->ring_lock);
5934-
ret_val = lpfc_sli4_issue_abort_iotag(phba, iocb,
5935-
lpfc_sli4_abort_fcp_cmpl);
5936-
} else {
5934+
else
59375935
pring = &phba->sli.sli3_ring[LPFC_FCP_RING];
5938-
ret_val = lpfc_sli_issue_abort_iotag(phba, pring, iocb,
5939-
lpfc_sli_abort_fcp_cmpl);
5940-
}
5936+
5937+
ret_val = lpfc_sli_issue_abort_iotag(phba, pring, iocb,
5938+
lpfc_sli_abort_fcp_cmpl);
59415939

59425940
/* Make sure HBA is alive */
59435941
lpfc_issue_hb_tmo(phba);

0 commit comments

Comments
 (0)