mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4
Convert the SLI4 fast and slow paths to use native SLI4 wqe constructs instead of iocb SLI3-isms. Includes the following: - Create simple get_xxx and set_xxx routines to wrapper access to common elements in both SLI3 and SLI4 commands - allowing calling routines to avoid sli-rev-specific structures to access the elements. - using the wqe in the job structure as the primary element - use defines from SLI-4, not SLI-3 - Removal of iocb to wqe conversion from fast and slow path - Add below routines to handle fast path lpfc_prep_embed_io - prepares the wqe for fast path lpfc_wqe_bpl2sgl - manages bpl to sgl conversion lpfc_sli_wqe2iocb - converts a WQE to IOCB for SLI-3 path - Add lpfc_sli3_iocb2wcqecmpl in completion path to convert an SLI-3 iocb completion to wcqe completion - Refactor some of the code that works on both revs for clarity Link: https://lore.kernel.org/r/20220225022308.16486-3-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>
This commit is contained in:
committed by
Martin K. Petersen
parent
a680a9298e
commit
1b64aa9eae
@@ -1797,3 +1797,39 @@ static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
|
||||
{
|
||||
return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
|
||||
}
|
||||
|
||||
static inline
|
||||
u8 get_job_ulpstatus(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
|
||||
{
|
||||
if (phba->sli_rev == LPFC_SLI_REV4)
|
||||
return bf_get(lpfc_wcqe_c_status, &iocbq->wcqe_cmpl);
|
||||
else
|
||||
return iocbq->iocb.ulpStatus;
|
||||
}
|
||||
|
||||
static inline
|
||||
u32 get_job_word4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
|
||||
{
|
||||
if (phba->sli_rev == LPFC_SLI_REV4)
|
||||
return iocbq->wcqe_cmpl.parameter;
|
||||
else
|
||||
return iocbq->iocb.un.ulpWord[4];
|
||||
}
|
||||
|
||||
static inline
|
||||
u8 get_job_cmnd(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
|
||||
{
|
||||
if (phba->sli_rev == LPFC_SLI_REV4)
|
||||
return bf_get(wqe_cmnd, &iocbq->wqe.generic.wqe_com);
|
||||
else
|
||||
return iocbq->iocb.ulpCommand;
|
||||
}
|
||||
|
||||
static inline
|
||||
u16 get_job_ulpcontext(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
|
||||
{
|
||||
if (phba->sli_rev == LPFC_SLI_REV4)
|
||||
return bf_get(wqe_ctxt_tag, &iocbq->wqe.generic.wqe_com);
|
||||
else
|
||||
return iocbq->iocb.ulpContext;
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ void lpfc_disc_list_loopmap(struct lpfc_vport *);
|
||||
void lpfc_disc_start(struct lpfc_vport *);
|
||||
void lpfc_cleanup_discovery_resources(struct lpfc_vport *);
|
||||
void lpfc_cleanup(struct lpfc_vport *);
|
||||
void lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_ncmd);
|
||||
void lpfc_disc_timeout(struct timer_list *);
|
||||
|
||||
int lpfc_unregister_fcf_prep(struct lpfc_hba *);
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
|
||||
((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
|
||||
|
||||
#define get_wqe_reqtag(x) (((x)->wqe.words[9] >> 0) & 0xFFFF)
|
||||
|
||||
#define get_job_ulpword(x, y) ((x)->iocb.un.ulpWord[y])
|
||||
|
||||
#define set_job_ulpstatus(x, y) bf_set(lpfc_wcqe_c_status, &(x)->wcqe_cmpl, y)
|
||||
#define set_job_ulpword4(x, y) ((&(x)->wcqe_cmpl)->parameter = y)
|
||||
|
||||
struct dma_address {
|
||||
uint32_t addr_lo;
|
||||
uint32_t addr_hi;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -76,6 +76,8 @@ struct lpfc_iocbq {
|
||||
struct lpfc_wcqe_complete wcqe_cmpl; /* WQE cmpl */
|
||||
|
||||
uint8_t num_bdes;
|
||||
uint8_t abort_bls; /* ABTS by initiator or responder */
|
||||
|
||||
uint8_t priority; /* OAS priority */
|
||||
uint8_t retry; /* retry counter for IOCB cmd - if needed */
|
||||
u32 cmd_flag;
|
||||
|
||||
Reference in New Issue
Block a user