Skip to content

Commit 64eb4dc

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
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: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 667a766 commit 64eb4dc

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13922,17 +13922,10 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t entry_size,
1392213922
}
1392313923
queue->entry_size = entry_size;
1392413924
queue->entry_count = entry_count;
13925-
13926-
/*
13927-
* entry_repost is calculated based on the number of entries in the
13928-
* queue. This works out except for RQs. If buffers are NOT initially
13929-
* posted for every RQE, entry_repost should be adjusted accordingly.
13930-
*/
13931-
queue->entry_repost = (entry_count >> 3);
13932-
if (queue->entry_repost < LPFC_QUEUE_MIN_REPOST)
13933-
queue->entry_repost = LPFC_QUEUE_MIN_REPOST;
1393413925
queue->phba = phba;
1393513926

13927+
/* entry_repost will be set during q creation */
13928+
1393613929
return queue;
1393713930
out_fail:
1393813931
lpfc_sli4_queue_free(queue);
@@ -14163,6 +14156,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
1416314156
status = -ENXIO;
1416414157
eq->host_index = 0;
1416514158
eq->hba_index = 0;
14159+
eq->entry_repost = LPFC_EQ_REPOST;
1416614160

1416714161
mempool_free(mbox, phba->mbox_mem_pool);
1416814162
return status;
@@ -14236,9 +14230,9 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
1423614230
default:
1423714231
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1423814232
"0361 Unsupported CQ count: "
14239-
"entry cnt %d sz %d pg cnt %d repost %d\n",
14233+
"entry cnt %d sz %d pg cnt %d\n",
1424014234
cq->entry_count, cq->entry_size,
14241-
cq->page_count, cq->entry_repost);
14235+
cq->page_count);
1424214236
if (cq->entry_count < 256) {
1424314237
status = -EINVAL;
1424414238
goto out;
@@ -14291,6 +14285,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
1429114285
cq->assoc_qid = eq->queue_id;
1429214286
cq->host_index = 0;
1429314287
cq->hba_index = 0;
14288+
cq->entry_repost = LPFC_CQ_REPOST;
1429414289

1429514290
out:
1429614291
mempool_free(mbox, phba->mbox_mem_pool);
@@ -14482,6 +14477,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
1448214477
cq->assoc_qid = eq->queue_id;
1448314478
cq->host_index = 0;
1448414479
cq->hba_index = 0;
14480+
cq->entry_repost = LPFC_CQ_REPOST;
1448514481

1448614482
rc = 0;
1448714483
list_for_each_entry(dmabuf, &cq->page_list, list) {
@@ -14730,6 +14726,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
1473014726
mq->subtype = subtype;
1473114727
mq->host_index = 0;
1473214728
mq->hba_index = 0;
14729+
mq->entry_repost = LPFC_MQ_REPOST;
1473314730

1473414731
/* link the mq onto the parent cq child list */
1473514732
list_add_tail(&mq->list, &cq->child_list);

drivers/scsi/lpfc/lpfc_sli4.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#define LPFC_XRI_EXCH_BUSY_WAIT_TMO 10000
2525
#define LPFC_XRI_EXCH_BUSY_WAIT_T1 10
2626
#define LPFC_XRI_EXCH_BUSY_WAIT_T2 30000
27-
#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32
2827
#define LPFC_RPI_LOW_WATER_MARK 10
2928

3029
#define LPFC_UNREG_FCF 1
@@ -155,8 +154,11 @@ struct lpfc_queue {
155154
uint32_t entry_count; /* Number of entries to support on the queue */
156155
uint32_t entry_size; /* Size of each queue entry. */
157156
uint32_t entry_repost; /* Count of entries before doorbell is rung */
158-
#define LPFC_QUEUE_MIN_REPOST 8
157+
#define LPFC_EQ_REPOST 8
158+
#define LPFC_MQ_REPOST 8
159+
#define LPFC_CQ_REPOST 64
159160
#define LPFC_RQ_REPOST 64
161+
#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32 /* For WQs */
160162
uint32_t queue_id; /* Queue ID assigned by the hardware */
161163
uint32_t assoc_qid; /* Queue ID associated with, for CQ/WQ/MQ */
162164
uint32_t page_count; /* Number of pages allocated for this queue */

0 commit comments

Comments
 (0)