aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib.h
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2012-05-07 14:02:42 -0400
committerRoland Dreier <roland@purestorage.com>2012-05-14 15:37:03 -0400
commitbb77a077232e78476d7bc39c080f9e6685cbfd3c (patch)
treed6b07dec8a7a7aa8fbbd752c2fd4b3b0c36088f9 /drivers/infiniband/hw/qib/qib.h
parentcca195a168ac062967fd1fa75c75546167b1e213 (diff)
IB/qib: Optimize pio ack buffer allocation
This patch optimizes pio buffer allocation in the kernel. For qib, kernel pio buffers are used for sending acks. The code to allocate the buffer would always start at 0 until it found a buffer. This means that an average of 64 comparisions were done on each allocate, since the busy bit won't be cleared until the bits are refreshed when buffers are exhausted. This patch adds two new fields in the devdata struct, last_pio and min_kernel_pio. last_pio is the last buffer that was allocated. min_kernel_pio is the lowest potential available buffer. min_kernel_pio is modifed as contexts are allocated and deallocted. Reviewed-by: Ramkrishna Vepa <ramkrishna.vepa@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib.h')
-rw-r--r--drivers/infiniband/hw/qib/qib.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index 6b811e3e8bd..2d638877c4a 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -873,7 +873,14 @@ struct qib_devdata {
873 * pio_writing. 873 * pio_writing.
874 */ 874 */
875 spinlock_t pioavail_lock; 875 spinlock_t pioavail_lock;
876 876 /*
877 * index of last buffer to optimize search for next
878 */
879 u32 last_pio;
880 /*
881 * min kernel pio buffer to optimize search
882 */
883 u32 min_kernel_pio;
877 /* 884 /*
878 * Shadow copies of registers; size indicates read access size. 885 * Shadow copies of registers; size indicates read access size.
879 * Most of them are readonly, but some are write-only register, 886 * Most of them are readonly, but some are write-only register,