From: James Smart Date: Fri, 25 Feb 2022 02:22:59 +0000 (-0800) Subject: scsi: lpfc: SLI path split: Refactor LS_RJT paths X-Git-Tag: microblaze-v5.19~133^2~11 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=e0367dfe90d6d5b2143311b0027c9c5d8878a30c;p=linux-2.6-microblaze.git 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 Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 66f3df66d178..69e7d1f024a3 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -5725,6 +5725,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError, struct lpfc_hba *phba = vport->phba; IOCB_t *icmd; IOCB_t *oldcmd; + union lpfc_wqe128 *wqe; struct lpfc_iocbq *elsiocb; uint8_t *pcmd; uint16_t cmdsize; @@ -5735,10 +5736,19 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError, if (!elsiocb) return 1; - icmd = &elsiocb->iocb; - oldcmd = &oldiocb->iocb; - icmd->ulpContext = oldcmd->ulpContext; /* Xri / rx_id */ - icmd->unsli3.rcvsli3.ox_id = oldcmd->unsli3.rcvsli3.ox_id; + if (phba->sli_rev == LPFC_SLI_REV4) { + wqe = &elsiocb->wqe; + bf_set(wqe_ctxt_tag, &wqe->generic.wqe_com, + get_job_ulpcontext(phba, oldiocb)); /* Xri / rx_id */ + bf_set(wqe_rcvoxid, &wqe->xmit_els_rsp.wqe_com, + get_job_rcvoxid(phba, oldiocb)); + } else { + icmd = &elsiocb->iocb; + oldcmd = &oldiocb->iocb; + icmd->ulpContext = oldcmd->ulpContext; /* Xri / rx_id */ + icmd->unsli3.rcvsli3.ox_id = oldcmd->unsli3.rcvsli3.ox_id; + } + pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); *((uint32_t *) (pcmd)) = ELS_CMD_LS_RJT; @@ -5754,7 +5764,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError, "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " "rpi x%x\n", rejectError, elsiocb->iotag, - elsiocb->iocb.ulpContext, ndlp->nlp_DID, + get_job_ulpcontext(phba, elsiocb), ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, "Issue LS_RJT: did:x%x flg:x%x err:x%x",