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

scsi: lpfc: Cleanup entry_repost settings on SLI4 queues

Too many work items being processed in IRQ context take a lot of CPU
time and cause problems.

With a recent change, we get out of the ISR after hitting entry_repost
work items on a queue. However, the actual values for entry repost are
still high. EQ is 128 and CQ is 128, this could translate into
processing 128 * 128 (16384) work items under IRQ context.

Set entry_repost in the actual queue creation routine now.  Limit EQ
repost to 8 and CQ repost to 64 to further limit the amount of time
spent in the IRQ.

Fix fof IRQ routines as well.
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.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 667a7662
...@@ -13922,17 +13922,10 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t entry_size, ...@@ -13922,17 +13922,10 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t entry_size,
} }
queue->entry_size = entry_size; queue->entry_size = entry_size;
queue->entry_count = entry_count; queue->entry_count = entry_count;
/*
* entry_repost is calculated based on the number of entries in the
* queue. This works out except for RQs. If buffers are NOT initially
* posted for every RQE, entry_repost should be adjusted accordingly.
*/
queue->entry_repost = (entry_count >> 3);
if (queue->entry_repost < LPFC_QUEUE_MIN_REPOST)
queue->entry_repost = LPFC_QUEUE_MIN_REPOST;
queue->phba = phba; queue->phba = phba;
/* entry_repost will be set during q creation */
return queue; return queue;
out_fail: out_fail:
lpfc_sli4_queue_free(queue); lpfc_sli4_queue_free(queue);
...@@ -14163,6 +14156,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax) ...@@ -14163,6 +14156,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
status = -ENXIO; status = -ENXIO;
eq->host_index = 0; eq->host_index = 0;
eq->hba_index = 0; eq->hba_index = 0;
eq->entry_repost = LPFC_EQ_REPOST;
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
return status; return status;
...@@ -14236,9 +14230,9 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, ...@@ -14236,9 +14230,9 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
default: default:
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"0361 Unsupported CQ count: " "0361 Unsupported CQ count: "
"entry cnt %d sz %d pg cnt %d repost %d\n", "entry cnt %d sz %d pg cnt %d\n",
cq->entry_count, cq->entry_size, cq->entry_count, cq->entry_size,
cq->page_count, cq->entry_repost); cq->page_count);
if (cq->entry_count < 256) { if (cq->entry_count < 256) {
status = -EINVAL; status = -EINVAL;
goto out; goto out;
...@@ -14291,6 +14285,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, ...@@ -14291,6 +14285,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
cq->assoc_qid = eq->queue_id; cq->assoc_qid = eq->queue_id;
cq->host_index = 0; cq->host_index = 0;
cq->hba_index = 0; cq->hba_index = 0;
cq->entry_repost = LPFC_CQ_REPOST;
out: out:
mempool_free(mbox, phba->mbox_mem_pool); mempool_free(mbox, phba->mbox_mem_pool);
...@@ -14482,6 +14477,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, ...@@ -14482,6 +14477,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
cq->assoc_qid = eq->queue_id; cq->assoc_qid = eq->queue_id;
cq->host_index = 0; cq->host_index = 0;
cq->hba_index = 0; cq->hba_index = 0;
cq->entry_repost = LPFC_CQ_REPOST;
rc = 0; rc = 0;
list_for_each_entry(dmabuf, &cq->page_list, list) { list_for_each_entry(dmabuf, &cq->page_list, list) {
...@@ -14730,6 +14726,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq, ...@@ -14730,6 +14726,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
mq->subtype = subtype; mq->subtype = subtype;
mq->host_index = 0; mq->host_index = 0;
mq->hba_index = 0; mq->hba_index = 0;
mq->entry_repost = LPFC_MQ_REPOST;
/* link the mq onto the parent cq child list */ /* link the mq onto the parent cq child list */
list_add_tail(&mq->list, &cq->child_list); list_add_tail(&mq->list, &cq->child_list);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#define LPFC_XRI_EXCH_BUSY_WAIT_TMO 10000 #define LPFC_XRI_EXCH_BUSY_WAIT_TMO 10000
#define LPFC_XRI_EXCH_BUSY_WAIT_T1 10 #define LPFC_XRI_EXCH_BUSY_WAIT_T1 10
#define LPFC_XRI_EXCH_BUSY_WAIT_T2 30000 #define LPFC_XRI_EXCH_BUSY_WAIT_T2 30000
#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32
#define LPFC_RPI_LOW_WATER_MARK 10 #define LPFC_RPI_LOW_WATER_MARK 10
#define LPFC_UNREG_FCF 1 #define LPFC_UNREG_FCF 1
...@@ -155,8 +154,11 @@ struct lpfc_queue { ...@@ -155,8 +154,11 @@ struct lpfc_queue {
uint32_t entry_count; /* Number of entries to support on the queue */ uint32_t entry_count; /* Number of entries to support on the queue */
uint32_t entry_size; /* Size of each queue entry. */ uint32_t entry_size; /* Size of each queue entry. */
uint32_t entry_repost; /* Count of entries before doorbell is rung */ uint32_t entry_repost; /* Count of entries before doorbell is rung */
#define LPFC_QUEUE_MIN_REPOST 8 #define LPFC_EQ_REPOST 8
#define LPFC_MQ_REPOST 8
#define LPFC_CQ_REPOST 64
#define LPFC_RQ_REPOST 64 #define LPFC_RQ_REPOST 64
#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32 /* For WQs */
uint32_t queue_id; /* Queue ID assigned by the hardware */ uint32_t queue_id; /* Queue ID assigned by the hardware */
uint32_t assoc_qid; /* Queue ID associated with, for CQ/WQ/MQ */ uint32_t assoc_qid; /* Queue ID associated with, for CQ/WQ/MQ */
uint32_t page_count; /* Number of pages allocated for this queue */ uint32_t page_count; /* Number of pages allocated for this queue */
......
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