Support for preallocation of SGL BSG data buffers
Subsystems (2)
cover Support for preallocation of SGL BSG data buffers
This set of patches includes a new feature and version update.
The initial three patches are related to "Support for preallocation of SGL BSG data buffers" and patches are interdependent. The fourth patch updates the driver version.
Chandrakanth patil (4):
mpi3mr: Support for preallocation of SGL BSG data buffers part-1
mpi3mr: Support for preallocation of SGL BSG data buffers part-2
mpi3mr: Support for preallocation of SGL BSG data buffers part-3
mpi3mr: Update driver version to 8.5.1.0.0
drivers/scsi/mpi3mr/mpi3mr.h | 31 +- drivers/scsi/mpi3mr/mpi3mr_app.c | 520 ++++++++++++++++++++++------ drivers/scsi/mpi3mr/mpi3mr_fw.c | 112 ++++++ include/uapi/scsi/scsi_bsg_mpi3mr.h | 2 + 4 files changed, 551 insertions(+), 114 deletions(-)
Signature · 1 line
2.39.3
PATCH 1/4 mpi3mr: Support for preallocation of SGL BSG data buffers part-1
The driver now supports SGLs for BSG data transfer. Upon loading, the driver pre-allocates SGLs in chunks of 8k, results in a total of 256 * 8k, equal to 2MB. These pre-allocated SGLs are reserved for handling BSG commands and are deallocated during driver unload.
--- drivers/scsi/mpi3mr/mpi3mr.h | 15 +++++ drivers/scsi/mpi3mr/mpi3mr_fw.c | 112 ++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+)
drivers/scsi/mpi3mr/mpi3mr.h +15 -0
@@ -477,6 +477,10 @@ struct mpi3mr_throttle_group_info {/* HBA port flags */ #define MPI3MR_HBA_PORT_FLAG_DIRTY 0x01 +/* IOCTL data transfer sge*/ +#define MPI3MR_NUM_IOCTL_SGE 256 +#define MPI3MR_IOCTL_SGE_SIZE (8 * 1024) +/** * struct mpi3mr_hba_port - HBA's port information * @port_id: Port number
@@ -1042,6 +1046,11 @@ struct scmd_priv {* @sas_node_lock: Lock to protect SAS node list * @hba_port_table_list: List of HBA Ports * @enclosure_list: List of Enclosure objects +* @ioctl_dma_pool: DMA pool for IOCTL data buffers +* @ioctl_sge: DMA buffer descriptors for IOCTL data +* @ioctl_chain_sge: DMA buffer descriptor for IOCTL chain +* @ioctl_resp_sge: DMA buffer descriptor for Mgmt cmd response +* @ioctl_sges_allocated: Flag for IOCTL SGEs allocated or not */ struct mpi3mr_ioc {struct list_head list;
@@ -1227,6 +1236,12 @@ struct mpi3mr_ioc {spinlock_t sas_node_lock;struct list_head hba_port_table_list;struct list_head enclosure_list; + +struct dma_pool *ioctl_dma_pool; +struct dma_memory_desc ioctl_sge[MPI3MR_NUM_IOCTL_SGE ]; +struct dma_memory_desc ioctl_chain_sge; +struct dma_memory_desc ioctl_resp_sge; +bool ioctl_sges_allocated; };/**
drivers/scsi/mpi3mr/mpi3mr_fw.c +112 -0
130 lines not on this page · raw message
Signature · 1 line
2.39.3
PATCH 2/4 mpi3mr: Support for preallocation of SGL BSG data buffers part-2
In reply to Chandrakanth patilThe Driver acquires the required SGLs from the pre-allocated pool.
--- drivers/scsi/mpi3mr/mpi3mr.h | 2 + drivers/scsi/mpi3mr/mpi3mr_app.c | 396 ++++++++++++++++++++++++------- 2 files changed, 313 insertions(+), 85 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +2 -0
@@ -247,6 +247,8 @@ struct mpi3mr_buf_map {u32 kern_buf_len;dma_addr_t kern_buf_dma;u8 data_dir; +u16 num_dma_desc; +struct dma_memory_desc *dma_desc; };/* IOC State definitions */
drivers/scsi/mpi3mr/mpi3mr_app.c +311 -85
583 lines not on this page · raw message
Signature · 1 line
2.39.3
PATCH 3/4 mpi3mr: Support for preallocation of SGL BSG data buffers part-3
In reply to Chandrakanth patilThe Driver acquires the required NVME SGLs from the pre-allocated pool.
--- drivers/scsi/mpi3mr/mpi3mr.h | 10 ++- drivers/scsi/mpi3mr/mpi3mr_app.c | 124 ++++++++++++++++++++++------ include/uapi/scsi/scsi_bsg_mpi3mr.h | 2 + 3 files changed, 109 insertions(+), 27 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +6 -4
@@ -218,14 +218,16 @@ extern atomic64_t event_counter;* @length: SGE length * @rsvd: Reserved * @rsvd1: Reserved -* @sgl_type: sgl type +* @sub_type: sgl sub type +* @type: sgl type */ struct mpi3mr_nvme_pt_sge { -u64 base_addr; -u32 length; +__le64 base_addr; +__le32 length;u16 rsvd;u8 rsvd1; -u8 sgl_type; +u8 sub_type:4 ; +u8 type:4 ; };/**
drivers/scsi/mpi3mr/mpi3mr_app.c +101 -23
200 lines not on this page · raw message
include/uapi/scsi/scsi_bsg_mpi3mr.h +2 -0
@@ -491,6 +491,8 @@ struct mpi3_nvme_encapsulated_error_reply {#define MPI3MR_NVME_DATA_FORMAT_PRP 0#define MPI3MR_NVME_DATA_FORMAT_SGL1 1#define MPI3MR_NVME_DATA_FORMAT_SGL2 2 +#define MPI3MR_NVMESGL_DATA_SEGMENT 0x00 +#define MPI3MR_NVMESGL_LAST_SEGMENT 0x03/* MPI3: task management related definitions */ struct mpi3_scsi_task_mgmt_request {
Signature · 1 line
2.39.3
PATCH 4/4 mpi3mr: Update driver version to 8.5.1.0.0
In reply to Chandrakanth patilUpdate driver version to 8.5.1.0.0
--- drivers/scsi/mpi3mr/mpi3mr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +2 -2
@@ -55,8 +55,8 @@ extern struct list_head mrioc_list;extern int prot_mask;extern atomic64_t event_counter; -#define MPI3MR_DRIVER_VERSION "8.5.0.0.50" -#define MPI3MR_DRIVER_RELDATE "22-November-2023" +#define MPI3MR_DRIVER_VERSION "8.5.1.0.0" +#define MPI3MR_DRIVER_RELDATE "5-December-2023"#define MPI3MR_DRIVER_NAME "mpi3mr"#define MPI3MR_DRIVER_LICENSE "GPL"
Signature · 1 line
2.39.3
Martin K. Petersen
AppliedChandrakanth,
Quoted 1 line
This set of patches includes a new feature and version update.
Applied to 6.8/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 6 lines · Chandrakanth patil
This set of patches includes a new feature and version update.
The initial three patches are related to "Support for preallocation of SGL BSG data buffers" and patches are interdependent. The fourth patch updates the driver version.
Quoted 7 lines
Chandrakanth patil (4):
mpi3mr: Support for preallocation of SGL BSG data buffers part-1
mpi3mr: Support for preallocation of SGL BSG data buffers part-2
mpi3mr: Support for preallocation of SGL BSG data buffers part-3
mpi3mr: Update driver version to 8.5.1.0.0[...]
Applied to 6.8/scsi-queue, thanks!
[1/4] mpi3mr: Support for preallocation of SGL BSG data buffers part-1
https://git.kernel.org/mkp/scsi/c/c432e1675239 [2/4] mpi3mr: Support for preallocation of SGL BSG data buffers part-2 https://git.kernel.org/mkp/scsi/c/fb231d7deffb [3/4] mpi3mr: Support for preallocation of SGL BSG data buffers part-3 https://git.kernel.org/mkp/scsi/c/9536af615dc9 [4/4] mpi3mr: Update driver version to 8.5.1.0.0 https://git.kernel.org/mkp/scsi/c/d0a60e3edaa4
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering