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

scsi: lpfc: Increase SCSI CQ and WQ sizes.

Increased the sizes of the SCSI WQ's and CQ's so that SCSI operation is
similar to that used by NVME. However, size increase restricted only to
those newer adapters that can support the larger WQE size, thus bigger
queue sizes.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b95e29b7
...@@ -7983,9 +7983,9 @@ lpfc_alloc_nvme_wq_cq(struct lpfc_hba *phba, int wqidx) ...@@ -7983,9 +7983,9 @@ lpfc_alloc_nvme_wq_cq(struct lpfc_hba *phba, int wqidx)
{ {
struct lpfc_queue *qdesc; struct lpfc_queue *qdesc;
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_NVME_PAGE_SIZE, qdesc = lpfc_sli4_queue_alloc(phba, LPFC_EXPANDED_PAGE_SIZE,
phba->sli4_hba.cq_esize, phba->sli4_hba.cq_esize,
LPFC_NVME_CQSIZE); LPFC_CQE_EXP_COUNT);
if (!qdesc) { if (!qdesc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0508 Failed allocate fast-path NVME CQ (%d)\n", "0508 Failed allocate fast-path NVME CQ (%d)\n",
...@@ -7994,8 +7994,8 @@ lpfc_alloc_nvme_wq_cq(struct lpfc_hba *phba, int wqidx) ...@@ -7994,8 +7994,8 @@ lpfc_alloc_nvme_wq_cq(struct lpfc_hba *phba, int wqidx)
} }
phba->sli4_hba.nvme_cq[wqidx] = qdesc; phba->sli4_hba.nvme_cq[wqidx] = qdesc;
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_NVME_PAGE_SIZE, qdesc = lpfc_sli4_queue_alloc(phba, LPFC_EXPANDED_PAGE_SIZE,
LPFC_WQE128_SIZE, LPFC_NVME_WQSIZE); LPFC_WQE128_SIZE, LPFC_WQE_EXP_COUNT);
if (!qdesc) { if (!qdesc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0509 Failed allocate fast-path NVME WQ (%d)\n", "0509 Failed allocate fast-path NVME WQ (%d)\n",
...@@ -8011,12 +8011,18 @@ static int ...@@ -8011,12 +8011,18 @@ static int
lpfc_alloc_fcp_wq_cq(struct lpfc_hba *phba, int wqidx) lpfc_alloc_fcp_wq_cq(struct lpfc_hba *phba, int wqidx)
{ {
struct lpfc_queue *qdesc; struct lpfc_queue *qdesc;
uint32_t wqesize;
/* Create Fast Path FCP CQs */ /* Create Fast Path FCP CQs */
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, if (phba->fcp_embed_io)
phba->sli4_hba.cq_esize, /* Increase the CQ size when WQEs contain an embedded cdb */
phba->sli4_hba.cq_ecount); qdesc = lpfc_sli4_queue_alloc(phba, LPFC_EXPANDED_PAGE_SIZE,
phba->sli4_hba.cq_esize,
LPFC_CQE_EXP_COUNT);
else
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE,
phba->sli4_hba.cq_esize,
phba->sli4_hba.cq_ecount);
if (!qdesc) { if (!qdesc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0499 Failed allocate fast-path FCP CQ (%d)\n", wqidx); "0499 Failed allocate fast-path FCP CQ (%d)\n", wqidx);
...@@ -8025,10 +8031,15 @@ lpfc_alloc_fcp_wq_cq(struct lpfc_hba *phba, int wqidx) ...@@ -8025,10 +8031,15 @@ lpfc_alloc_fcp_wq_cq(struct lpfc_hba *phba, int wqidx)
phba->sli4_hba.fcp_cq[wqidx] = qdesc; phba->sli4_hba.fcp_cq[wqidx] = qdesc;
/* Create Fast Path FCP WQs */ /* Create Fast Path FCP WQs */
wqesize = (phba->fcp_embed_io) ? if (phba->fcp_embed_io)
LPFC_WQE128_SIZE : phba->sli4_hba.wq_esize; /* Increase the WQ size when WQEs contain an embedded cdb */
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, qdesc = lpfc_sli4_queue_alloc(phba, LPFC_EXPANDED_PAGE_SIZE,
wqesize, phba->sli4_hba.wq_ecount); LPFC_WQE128_SIZE,
LPFC_WQE_EXP_COUNT);
else
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE,
phba->sli4_hba.wq_esize,
phba->sli4_hba.wq_ecount);
if (!qdesc) { if (!qdesc) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"0503 Failed allocate fast-path FCP WQ (%d)\n", "0503 Failed allocate fast-path FCP WQ (%d)\n",
...@@ -12216,7 +12227,6 @@ int ...@@ -12216,7 +12227,6 @@ int
lpfc_fof_queue_create(struct lpfc_hba *phba) lpfc_fof_queue_create(struct lpfc_hba *phba)
{ {
struct lpfc_queue *qdesc; struct lpfc_queue *qdesc;
uint32_t wqesize;
/* Create FOF EQ */ /* Create FOF EQ */
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE,
...@@ -12230,21 +12240,32 @@ lpfc_fof_queue_create(struct lpfc_hba *phba) ...@@ -12230,21 +12240,32 @@ lpfc_fof_queue_create(struct lpfc_hba *phba)
if (phba->cfg_fof) { if (phba->cfg_fof) {
/* Create OAS CQ */ /* Create OAS CQ */
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, if (phba->fcp_embed_io)
phba->sli4_hba.cq_esize, qdesc = lpfc_sli4_queue_alloc(phba,
phba->sli4_hba.cq_ecount); LPFC_EXPANDED_PAGE_SIZE,
phba->sli4_hba.cq_esize,
LPFC_CQE_EXP_COUNT);
else
qdesc = lpfc_sli4_queue_alloc(phba,
LPFC_DEFAULT_PAGE_SIZE,
phba->sli4_hba.cq_esize,
phba->sli4_hba.cq_ecount);
if (!qdesc) if (!qdesc)
goto out_error; goto out_error;
phba->sli4_hba.oas_cq = qdesc; phba->sli4_hba.oas_cq = qdesc;
/* Create OAS WQ */ /* Create OAS WQ */
wqesize = (phba->fcp_embed_io) ? if (phba->fcp_embed_io)
LPFC_WQE128_SIZE : phba->sli4_hba.wq_esize; qdesc = lpfc_sli4_queue_alloc(phba,
qdesc = lpfc_sli4_queue_alloc(phba, LPFC_DEFAULT_PAGE_SIZE, LPFC_EXPANDED_PAGE_SIZE,
wqesize, LPFC_WQE128_SIZE,
phba->sli4_hba.wq_ecount); LPFC_WQE_EXP_COUNT);
else
qdesc = lpfc_sli4_queue_alloc(phba,
LPFC_DEFAULT_PAGE_SIZE,
phba->sli4_hba.wq_esize,
phba->sli4_hba.wq_ecount);
if (!qdesc) if (!qdesc)
goto out_error; goto out_error;
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
********************************************************************/ ********************************************************************/
#define LPFC_NVME_DEFAULT_SEGS (64 + 1) /* 256K IOs */ #define LPFC_NVME_DEFAULT_SEGS (64 + 1) /* 256K IOs */
#define LPFC_NVME_WQSIZE 1024
#define LPFC_NVME_CQSIZE 4096
#define LPFC_NVME_ERSP_LEN 0x20 #define LPFC_NVME_ERSP_LEN 0x20
......
...@@ -170,7 +170,7 @@ struct lpfc_queue { ...@@ -170,7 +170,7 @@ struct lpfc_queue {
uint32_t q_mode; uint32_t q_mode;
uint16_t page_count; /* Number of pages allocated for this queue */ uint16_t page_count; /* Number of pages allocated for this queue */
uint16_t page_size; /* size of page allocated for this queue */ uint16_t page_size; /* size of page allocated for this queue */
#define LPFC_NVME_PAGE_SIZE 16384 #define LPFC_EXPANDED_PAGE_SIZE 16384
#define LPFC_DEFAULT_PAGE_SIZE 4096 #define LPFC_DEFAULT_PAGE_SIZE 4096
uint16_t chann; /* IO channel this queue is associated with */ uint16_t chann; /* IO channel this queue is associated with */
uint16_t db_format; uint16_t db_format;
...@@ -370,9 +370,9 @@ struct lpfc_bmbx { ...@@ -370,9 +370,9 @@ struct lpfc_bmbx {
#define LPFC_EQE_DEF_COUNT 1024 #define LPFC_EQE_DEF_COUNT 1024
#define LPFC_CQE_DEF_COUNT 1024 #define LPFC_CQE_DEF_COUNT 1024
#define LPFC_CQE_EXP_COUNT 4096
#define LPFC_WQE_DEF_COUNT 256 #define LPFC_WQE_DEF_COUNT 256
#define LPFC_WQE128_DEF_COUNT 128 #define LPFC_WQE_EXP_COUNT 1024
#define LPFC_WQE128_MAX_COUNT 256
#define LPFC_MQE_DEF_COUNT 16 #define LPFC_MQE_DEF_COUNT 16
#define LPFC_RQE_DEF_COUNT 512 #define LPFC_RQE_DEF_COUNT 512
......
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