summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_iba7322.c
diff options
context:
space:
mode:
authorMike Marciniszyn2012-05-07 20:02:42 +0200
committerRoland Dreier2012-05-14 21:37:03 +0200
commitbb77a077232e78476d7bc39c080f9e6685cbfd3c (patch)
treed6b07dec8a7a7aa8fbbd752c2fd4b3b0c36088f9 /drivers/infiniband/hw/qib/qib_iba7322.c
parentIB/qib: Add prefetch for eager buffers (diff)
downloadkernel-qcow2-linux-bb77a077232e78476d7bc39c080f9e6685cbfd3c.tar.gz
kernel-qcow2-linux-bb77a077232e78476d7bc39c080f9e6685cbfd3c.tar.xz
kernel-qcow2-linux-bb77a077232e78476d7bc39c080f9e6685cbfd3c.zip
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_iba7322.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_iba7322.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 060b96064469..e7b9ad34fe2e 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -6379,6 +6379,7 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
dd->cspec->sdmabufcnt;
dd->lastctxt_piobuf = dd->cspec->lastbuf_for_pio - sbufs;
dd->cspec->lastbuf_for_pio--; /* range is <= , not < */
+ dd->last_pio = dd->cspec->lastbuf_for_pio;
dd->pbufsctxt = (dd->cfgctxts > dd->first_user_ctxt) ?
dd->lastctxt_piobuf / (dd->cfgctxts - dd->first_user_ctxt) : 0;