Commit 3512ac09 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: SLI path split: Refactor SCSI paths

This patch refactors the SCSI 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-14-jsmart2021@gmail.comCo-developed-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 61910d6a
...@@ -916,6 +916,10 @@ struct lpfc_hba { ...@@ -916,6 +916,10 @@ struct lpfc_hba {
(struct lpfc_vport *vport, (struct lpfc_vport *vport,
struct lpfc_io_buf *lpfc_cmd, struct lpfc_io_buf *lpfc_cmd,
uint8_t tmo); uint8_t tmo);
int (*lpfc_scsi_prep_task_mgmt_cmd)
(struct lpfc_vport *vport,
struct lpfc_io_buf *lpfc_cmd,
u64 lun, u8 task_mgmt_cmd);
/* IOCB interface function jump table entries */ /* IOCB interface function jump table entries */
int (*__lpfc_sli_issue_iocb) int (*__lpfc_sli_issue_iocb)
......
This diff is collapsed.
...@@ -12648,6 +12648,7 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba, ...@@ -12648,6 +12648,7 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba,
wait_queue_head_t *pdone_q; wait_queue_head_t *pdone_q;
unsigned long iflags; unsigned long iflags;
struct lpfc_io_buf *lpfc_cmd; struct lpfc_io_buf *lpfc_cmd;
size_t offset = offsetof(struct lpfc_iocbq, wqe);
spin_lock_irqsave(&phba->hbalock, iflags); spin_lock_irqsave(&phba->hbalock, iflags);
if (cmdiocbq->cmd_flag & LPFC_IO_WAKE_TMO) { if (cmdiocbq->cmd_flag & LPFC_IO_WAKE_TMO) {
...@@ -12668,10 +12669,11 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba, ...@@ -12668,10 +12669,11 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba,
return; return;
} }
/* Copy the contents of the local rspiocb into the caller's buffer. */
cmdiocbq->cmd_flag |= LPFC_IO_WAKE; cmdiocbq->cmd_flag |= LPFC_IO_WAKE;
if (cmdiocbq->context2 && rspiocbq) if (cmdiocbq->context2 && rspiocbq)
memcpy(&((struct lpfc_iocbq *)cmdiocbq->context2)->iocb, memcpy((char *)cmdiocbq->context2 + offset,
&rspiocbq->iocb, sizeof(IOCB_t)); (char *)rspiocbq + offset, sizeof(*rspiocbq) - offset);
/* Set the exchange busy flag for task management commands */ /* Set the exchange busy flag for task management commands */
if ((cmdiocbq->cmd_flag & LPFC_IO_FCP) && if ((cmdiocbq->cmd_flag & LPFC_IO_FCP) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment