Skip to content

Commit 6831ce1

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
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 <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 5613414 commit 6831ce1

7 files changed

Lines changed: 453 additions & 240 deletions

File tree

drivers/scsi/lpfc/lpfc.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,13 @@ struct lpfc_hba {
961961

962962
int (*lpfc_bg_scsi_prep_dma_buf)
963963
(struct lpfc_hba *, struct lpfc_io_buf *);
964-
/* Add new entries here */
964+
965+
/* Prep SLI WQE/IOCB jump table entries */
966+
void (*__lpfc_sli_prep_els_req_rsp)(struct lpfc_iocbq *cmdiocbq,
967+
struct lpfc_vport *vport,
968+
struct lpfc_dmabuf *bmp,
969+
u16 cmd_size, u32 did, u32 elscmd,
970+
u8 tmo, u8 expect_rsp);
965971

966972
/* expedite pool */
967973
struct lpfc_epd_pool epd_pool;
@@ -1833,3 +1839,12 @@ u16 get_job_ulpcontext(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
18331839
else
18341840
return iocbq->iocb.ulpContext;
18351841
}
1842+
1843+
static inline
1844+
u32 get_job_els_rsp64_did(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
1845+
{
1846+
if (phba->sli_rev == LPFC_SLI_REV4)
1847+
return bf_get(wqe_els_did, &iocbq->wqe.els_req.wqe_dest);
1848+
else
1849+
return iocbq->iocb.un.elsreq64.remoteID;
1850+
}

drivers/scsi/lpfc/lpfc_crtn.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ int lpfc_sli4_issue_wqe(struct lpfc_hba *phba, struct lpfc_sli4_hdw_queue *qp,
353353
struct lpfc_iocbq *pwqe);
354354
int lpfc_sli4_issue_abort_iotag(struct lpfc_hba *phba,
355355
struct lpfc_iocbq *cmdiocb, void *cmpl);
356+
void lpfc_sli_prep_els_req_rsp(struct lpfc_hba *phba,
357+
struct lpfc_iocbq *cmdiocbq,
358+
struct lpfc_vport *vport,
359+
struct lpfc_dmabuf *bmp, u16 cmd_size, u32 did,
360+
u32 elscmd, u8 tmo, u8 expect_rsp);
356361
struct lpfc_sglq *__lpfc_clear_active_sglq(struct lpfc_hba *phba, uint16_t xri);
357362
struct lpfc_sglq *__lpfc_sli_get_nvmet_sglq(struct lpfc_hba *phba,
358363
struct lpfc_iocbq *piocbq);

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
982982
lpfc_vport_set_state(vport, FC_VPORT_FAILED);
983983
goto out;
984984
}
985-
if (lpfc_error_lost_link(irsp)) {
985+
if (lpfc_error_lost_link(irsp->ulpStatus, irsp->un.ulpWord[4])) {
986986
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
987987
"0226 NS query failed due to link event\n");
988988
if (vport->fc_flag & FC_RSCN_MODE)
@@ -1199,7 +1199,7 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11991199
lpfc_vport_set_state(vport, FC_VPORT_FAILED);
12001200
goto out;
12011201
}
1202-
if (lpfc_error_lost_link(irsp)) {
1202+
if (lpfc_error_lost_link(irsp->ulpStatus, irsp->un.ulpWord[4])) {
12031203
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
12041204
"4166 NS query failed due to link event\n");
12051205
if (vport->fc_flag & FC_RSCN_MODE)

0 commit comments

Comments
 (0)