Commit e3e2863d authored by Dick Kennedy's avatar Dick Kennedy Committed by Martin K. Petersen

scsi: lpfc: Limit amount of work processed in IRQ

Various oops being seen on being in the ISR too long and cpu lockups,
when under heavy load.

The amount of work being posted off of completion queues kept the ISR
running almost all the time

Correct the issue by limiting the amount of work per iteration.

[mkp: typo]
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 176de5bb
...@@ -80,8 +80,8 @@ static int lpfc_sli4_fp_handle_cqe(struct lpfc_hba *, struct lpfc_queue *, ...@@ -80,8 +80,8 @@ static int lpfc_sli4_fp_handle_cqe(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_cqe *); struct lpfc_cqe *);
static int lpfc_sli4_post_sgl_list(struct lpfc_hba *, struct list_head *, static int lpfc_sli4_post_sgl_list(struct lpfc_hba *, struct list_head *,
int); int);
static void lpfc_sli4_hba_handle_eqe(struct lpfc_hba *, struct lpfc_eqe *, static int lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba,
uint32_t); struct lpfc_eqe *eqe, uint32_t qidx);
static bool lpfc_sli4_mbox_completions_pending(struct lpfc_hba *phba); static bool lpfc_sli4_mbox_completions_pending(struct lpfc_hba *phba);
static bool lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba); static bool lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba);
static int lpfc_sli4_abort_nvme_io(struct lpfc_hba *phba, static int lpfc_sli4_abort_nvme_io(struct lpfc_hba *phba,
...@@ -13010,7 +13010,7 @@ lpfc_sli4_sp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, ...@@ -13010,7 +13010,7 @@ lpfc_sli4_sp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq,
* completion queue, and then return. * completion queue, and then return.
* *
**/ **/
static void static int
lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
struct lpfc_queue *speq) struct lpfc_queue *speq)
{ {
...@@ -13034,7 +13034,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13034,7 +13034,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"0365 Slow-path CQ identifier " "0365 Slow-path CQ identifier "
"(%d) does not exist\n", cqid); "(%d) does not exist\n", cqid);
return; return 0;
} }
/* Save EQ associated with this CQ */ /* Save EQ associated with this CQ */
...@@ -13071,7 +13071,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13071,7 +13071,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
lpfc_printf_log(phba, KERN_ERR, LOG_SLI, lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"0370 Invalid completion queue type (%d)\n", "0370 Invalid completion queue type (%d)\n",
cq->type); cq->type);
return; return 0;
} }
/* Catch the no cq entry condition, log an error */ /* Catch the no cq entry condition, log an error */
...@@ -13086,6 +13086,8 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13086,6 +13086,8 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
/* wake up worker thread if there are works to be done */ /* wake up worker thread if there are works to be done */
if (workposted) if (workposted)
lpfc_worker_wake_up(phba); lpfc_worker_wake_up(phba);
return ecount;
} }
/** /**
...@@ -13393,7 +13395,7 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, ...@@ -13393,7 +13395,7 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq,
* queue and process all the entries on the completion queue, rearm the * queue and process all the entries on the completion queue, rearm the
* completion queue, and then return. * completion queue, and then return.
**/ **/
static void static int
lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
uint32_t qidx) uint32_t qidx)
{ {
...@@ -13409,7 +13411,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13409,7 +13411,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
"event: majorcode=x%x, minorcode=x%x\n", "event: majorcode=x%x, minorcode=x%x\n",
bf_get_le32(lpfc_eqe_major_code, eqe), bf_get_le32(lpfc_eqe_major_code, eqe),
bf_get_le32(lpfc_eqe_minor_code, eqe)); bf_get_le32(lpfc_eqe_minor_code, eqe));
return; return 0;
} }
/* Get the reference to the corresponding CQ */ /* Get the reference to the corresponding CQ */
...@@ -13446,8 +13448,9 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13446,8 +13448,9 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
/* Otherwise this is a Slow path event */ /* Otherwise this is a Slow path event */
if (cq == NULL) { if (cq == NULL) {
lpfc_sli4_sp_handle_eqe(phba, eqe, phba->sli4_hba.hba_eq[qidx]); ecount = lpfc_sli4_sp_handle_eqe(phba, eqe,
return; phba->sli4_hba.hba_eq[qidx]);
return ecount;
} }
process_cq: process_cq:
...@@ -13456,7 +13459,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13456,7 +13459,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
"0368 Miss-matched fast-path completion " "0368 Miss-matched fast-path completion "
"queue identifier: eqcqid=%d, fcpcqid=%d\n", "queue identifier: eqcqid=%d, fcpcqid=%d\n",
cqid, cq->queue_id); cqid, cq->queue_id);
return; return 0;
} }
/* Save EQ associated with this CQ */ /* Save EQ associated with this CQ */
...@@ -13486,6 +13489,8 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, ...@@ -13486,6 +13489,8 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe,
/* wake up worker thread if there are works to be done */ /* wake up worker thread if there are works to be done */
if (workposted) if (workposted)
lpfc_worker_wake_up(phba); lpfc_worker_wake_up(phba);
return ecount;
} }
static void static void
...@@ -13706,6 +13711,7 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id) ...@@ -13706,6 +13711,7 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id)
struct lpfc_eqe *eqe; struct lpfc_eqe *eqe;
unsigned long iflag; unsigned long iflag;
int ecount = 0; int ecount = 0;
int ccount = 0;
int hba_eqidx; int hba_eqidx;
/* Get the driver's phba structure from the dev_id */ /* Get the driver's phba structure from the dev_id */
...@@ -13757,8 +13763,9 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id) ...@@ -13757,8 +13763,9 @@ lpfc_sli4_hba_intr_handler(int irq, void *dev_id)
if (eqe == NULL) if (eqe == NULL)
break; break;
lpfc_sli4_hba_handle_eqe(phba, eqe, hba_eqidx); ccount += lpfc_sli4_hba_handle_eqe(phba, eqe, hba_eqidx);
if (!(++ecount % fpeq->entry_repost)) if (!(++ecount % fpeq->entry_repost) ||
ccount > LPFC_MAX_ISR_CQE)
break; break;
fpeq->EQ_processed++; fpeq->EQ_processed++;
} }
......
...@@ -158,6 +158,7 @@ struct lpfc_queue { ...@@ -158,6 +158,7 @@ struct lpfc_queue {
#define LPFC_MQ_REPOST 8 #define LPFC_MQ_REPOST 8
#define LPFC_CQ_REPOST 64 #define LPFC_CQ_REPOST 64
#define LPFC_RQ_REPOST 64 #define LPFC_RQ_REPOST 64
#define LPFC_MAX_ISR_CQE 64
#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32 /* For WQs */ #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 */
......
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