Skip to content

Commit e0367df

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: SLI path split: Refactor LS_RJT paths
This patch refactors the LS_RJT paths to use SLI-4 as the primary interface: - 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-9-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 3f607dc commit e0367df

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5725,6 +5725,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
57255725
struct lpfc_hba *phba = vport->phba;
57265726
IOCB_t *icmd;
57275727
IOCB_t *oldcmd;
5728+
union lpfc_wqe128 *wqe;
57285729
struct lpfc_iocbq *elsiocb;
57295730
uint8_t *pcmd;
57305731
uint16_t cmdsize;
@@ -5735,10 +5736,19 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
57355736
if (!elsiocb)
57365737
return 1;
57375738

5738-
icmd = &elsiocb->iocb;
5739-
oldcmd = &oldiocb->iocb;
5740-
icmd->ulpContext = oldcmd->ulpContext; /* Xri / rx_id */
5741-
icmd->unsli3.rcvsli3.ox_id = oldcmd->unsli3.rcvsli3.ox_id;
5739+
if (phba->sli_rev == LPFC_SLI_REV4) {
5740+
wqe = &elsiocb->wqe;
5741+
bf_set(wqe_ctxt_tag, &wqe->generic.wqe_com,
5742+
get_job_ulpcontext(phba, oldiocb)); /* Xri / rx_id */
5743+
bf_set(wqe_rcvoxid, &wqe->xmit_els_rsp.wqe_com,
5744+
get_job_rcvoxid(phba, oldiocb));
5745+
} else {
5746+
icmd = &elsiocb->iocb;
5747+
oldcmd = &oldiocb->iocb;
5748+
icmd->ulpContext = oldcmd->ulpContext; /* Xri / rx_id */
5749+
icmd->unsli3.rcvsli3.ox_id = oldcmd->unsli3.rcvsli3.ox_id;
5750+
}
5751+
57425752
pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
57435753

57445754
*((uint32_t *) (pcmd)) = ELS_CMD_LS_RJT;
@@ -5754,7 +5764,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
57545764
"xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
57555765
"rpi x%x\n",
57565766
rejectError, elsiocb->iotag,
5757-
elsiocb->iocb.ulpContext, ndlp->nlp_DID,
5767+
get_job_ulpcontext(phba, elsiocb), ndlp->nlp_DID,
57585768
ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
57595769
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
57605770
"Issue LS_RJT: did:x%x flg:x%x err:x%x",

0 commit comments

Comments
 (0)