summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_scsi.h
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2019-01-28 22:14:19 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2019-02-06 06:22:42 +0300
commit0794d601d1748b007dc338127232e74c19fd1337 (patch)
tree2fdcc1c1a60c975e735706176ae761df00dc1891 /drivers/scsi/lpfc/lpfc_scsi.h
parente960f5ab40b6a31847c4b259aaece4a4b29556ad (diff)
downloadlinux-0794d601d1748b007dc338127232e74c19fd1337.tar.xz
scsi: lpfc: Implement common IO buffers between NVME and SCSI
Currently, both NVME and SCSI get their IO buffers from separate pools. XRI's are associated 1:1 with IO buffers, so XRI's are also split between protocols. Eliminate the independent pools and use a single pool. Each buffer structure now has a common section and a protocol section. Per protocol routines for SGL initialization are removed and replaced by common routines. Initialization of the buffers is only done on the common area. All other fields, which are protocol specific, are initialized when the buffer is allocated for use in the per-protocol allocation routine. In the past, the SCSI side allocated IO buffers as part of slave_alloc calls until the maximum XRIs for SCSI was reached. As all XRIs are now common and may be used for either protocol, allocation for everything is done as part of adapter initialization and the scsi side has no action in slave alloc. As XRI's are no longer split, the lpfc_xri_split module parameter is removed. Adapters based on SLI3 will continue to use the older scsi_buf_list_get/put routines. All SLI4 adapters utilize the new IO buffer scheme Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.h')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.h b/drivers/scsi/lpfc/lpfc_scsi.h
index b759b089432c..d784de3da0c0 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.h
+++ b/drivers/scsi/lpfc/lpfc_scsi.h
@@ -131,7 +131,15 @@ struct lpfc_scsicmd_bkt {
};
struct lpfc_scsi_buf {
+ /* Common fields */
struct list_head list;
+ void *data;
+ dma_addr_t dma_handle;
+ dma_addr_t dma_phys_sgl;
+ struct ulp_bde64 *dma_sgl;
+ struct lpfc_iocbq cur_iocbq;
+
+ /* SCSI specific fields */
struct scsi_cmnd *pCmd;
struct lpfc_rport_data *rdata;
struct lpfc_nodelist *ndlp;
@@ -139,9 +147,10 @@ struct lpfc_scsi_buf {
uint32_t timeout;
uint16_t flags; /* TBD convert exch_busy to flags */
-#define LPFC_SBUF_XBUSY 0x1 /* SLI4 hba reported XB on WCQE cmpl */
-#define LPFC_SBUF_BUMP_QDEPTH 0x8 /* bumped queue depth counter */
+#define LPFC_SBUF_XBUSY 0x1 /* SLI4 hba reported XB on WCQE cmpl */
+#define LPFC_SBUF_BUMP_QDEPTH 0x2 /* bumped queue depth counter */
uint16_t exch_busy; /* SLI4 hba reported XB on complete WCQE */
+ uint16_t cpu;
uint16_t status; /* From IOCB Word 7- ulpStatus */
uint32_t result; /* From IOCB Word 4. */
@@ -150,27 +159,13 @@ struct lpfc_scsi_buf {
* to dma_unmap_sg. */
uint32_t prot_seg_cnt; /* seg_cnt's counterpart for protection data */
- dma_addr_t nonsg_phys; /* Non scatter-gather physical address. */
-
/*
* data and dma_handle are the kernel virtual and bus address of the
* dma-able buffer containing the fcp_cmd, fcp_rsp and a scatter
* gather bde list that supports the sg_tablesize value.
*/
- void *data;
- dma_addr_t dma_handle;
-
struct fcp_cmnd *fcp_cmnd;
struct fcp_rsp *fcp_rsp;
- struct ulp_bde64 *fcp_bpl;
-
- dma_addr_t dma_phys_bpl;
-
- /* cur_iocbq has phys of the dma-able buffer.
- * Iotag is in here
- */
- struct lpfc_iocbq cur_iocbq;
- uint16_t cpu;
wait_queue_head_t *waitq;
unsigned long start_time;