[openib-general] [PATCH for-2.6.19] IB/mthca: fix off-by-one in create_srq
Michael S. Tsirkin
mst at mellanox.co.il
Mon Oct 9 03:04:30 PDT 2006
Tavor needs a spare entry in SRQ - same as memfree.
Note that in userspace libmthca already handles this correctly.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
---
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 0f316c8..46b2747 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -201,6 +201,8 @@ int mthca_alloc_srq(struct mthca_dev *de
if (mthca_is_memfree(dev))
srq->max = roundup_pow_of_two(srq->max + 1);
+ else
+ srq->max = srq->max + 1;
ds = max(64UL,
roundup_pow_of_two(sizeof (struct mthca_next_seg) +
--
MST
More information about the general
mailing list