Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] fnic: Process all cq entries per ISR

Driver was processing a fixed max number of cq descriptors per ISR. For
instance, for the SCSI IO queue, number of IOs processed per ISR were 8.
If hardware writes 9 cq descriptors to the cq and generates an interrupt,
driver would process only 8 descriptors and decrement the outstanding
credit count by 8. Unless another interrupt event happens, the hw does
not generate any additional interrupt. This results in the cq descriptor
sitting in the queue without being procesed and can cause IO timeouts
and aborts.

Modify all ISR functions to process all queued cq descriptors in one shot.
Since bulk of ELS frame processing is done in thread context and bulk
of SCSI IO processing is done in soft ISR deferred context, the cycles
spent in the ISR per cq descriptor is small.

Signed-off-by: Herman Lee <hermlee@cisco.com>
Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Abhijeet Joglekar and committed by
James Bottomley
d5cf4b28 8f550f93

+9 -9
+9 -9
drivers/scsi/fnic/fnic_isr.c
··· 48 48 } 49 49 50 50 if (pba & (1 << FNIC_INTX_WQ_RQ_COPYWQ)) { 51 - work_done += fnic_wq_copy_cmpl_handler(fnic, 8); 52 - work_done += fnic_wq_cmpl_handler(fnic, 4); 53 - work_done += fnic_rq_cmpl_handler(fnic, 4); 51 + work_done += fnic_wq_copy_cmpl_handler(fnic, -1); 52 + work_done += fnic_wq_cmpl_handler(fnic, -1); 53 + work_done += fnic_rq_cmpl_handler(fnic, -1); 54 54 55 55 vnic_intr_return_credits(&fnic->intr[FNIC_INTX_WQ_RQ_COPYWQ], 56 56 work_done, ··· 66 66 struct fnic *fnic = data; 67 67 unsigned long work_done = 0; 68 68 69 - work_done += fnic_wq_copy_cmpl_handler(fnic, 8); 70 - work_done += fnic_wq_cmpl_handler(fnic, 4); 71 - work_done += fnic_rq_cmpl_handler(fnic, 4); 69 + work_done += fnic_wq_copy_cmpl_handler(fnic, -1); 70 + work_done += fnic_wq_cmpl_handler(fnic, -1); 71 + work_done += fnic_rq_cmpl_handler(fnic, -1); 72 72 73 73 vnic_intr_return_credits(&fnic->intr[0], 74 74 work_done, ··· 83 83 struct fnic *fnic = data; 84 84 unsigned long rq_work_done = 0; 85 85 86 - rq_work_done = fnic_rq_cmpl_handler(fnic, 4); 86 + rq_work_done = fnic_rq_cmpl_handler(fnic, -1); 87 87 vnic_intr_return_credits(&fnic->intr[FNIC_MSIX_RQ], 88 88 rq_work_done, 89 89 1 /* unmask intr */, ··· 97 97 struct fnic *fnic = data; 98 98 unsigned long wq_work_done = 0; 99 99 100 - wq_work_done = fnic_wq_cmpl_handler(fnic, 4); 100 + wq_work_done = fnic_wq_cmpl_handler(fnic, -1); 101 101 vnic_intr_return_credits(&fnic->intr[FNIC_MSIX_WQ], 102 102 wq_work_done, 103 103 1 /* unmask intr */, ··· 110 110 struct fnic *fnic = data; 111 111 unsigned long wq_copy_work_done = 0; 112 112 113 - wq_copy_work_done = fnic_wq_copy_cmpl_handler(fnic, 8); 113 + wq_copy_work_done = fnic_wq_copy_cmpl_handler(fnic, -1); 114 114 vnic_intr_return_credits(&fnic->intr[FNIC_MSIX_WQ_COPY], 115 115 wq_copy_work_done, 116 116 1 /* unmask intr */,