From 6831ce129f1948f50f2d2a57995d2ebd7a6fa0b4 Mon Sep 17 00:00:00 2001 From: James Smart Date: Thu, 24 Feb 2022 18:22:55 -0800 Subject: scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path The patch refactors the general ELS handling paths to migrate to SLI-4 structures or common element abstractions. The fabric login paths are revised as part of this patch: - New generic lpfc_sli_prep_els_req_rsp jump table routine - Introduce ls_rjt_error_be and ulp_bde64_le unions to correct legacy endianness assignments - 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. - Clean up poor indentation on some of the ELS paths Link: https://lore.kernel.org/r/20220225022308.16486-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'drivers/scsi/lpfc/lpfc.h') diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index fa0ef4feade6..83deab076d17 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -961,7 +961,13 @@ struct lpfc_hba { int (*lpfc_bg_scsi_prep_dma_buf) (struct lpfc_hba *, struct lpfc_io_buf *); - /* Add new entries here */ + + /* Prep SLI WQE/IOCB jump table entries */ + void (*__lpfc_sli_prep_els_req_rsp)(struct lpfc_iocbq *cmdiocbq, + struct lpfc_vport *vport, + struct lpfc_dmabuf *bmp, + u16 cmd_size, u32 did, u32 elscmd, + u8 tmo, u8 expect_rsp); /* expedite pool */ struct lpfc_epd_pool epd_pool; @@ -1833,3 +1839,12 @@ u16 get_job_ulpcontext(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) else return iocbq->iocb.ulpContext; } + +static inline +u32 get_job_els_rsp64_did(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) +{ + if (phba->sli_rev == LPFC_SLI_REV4) + return bf_get(wqe_els_did, &iocbq->wqe.els_req.wqe_dest); + else + return iocbq->iocb.un.elsreq64.remoteID; +} -- cgit v1.2.3