aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mthca
diff options
context:
space:
mode:
authorDotan Barak <dotanb@mellanox.co.il>2006-03-20 10:08:26 -0800
committerRoland Dreier <rolandd@cisco.com>2006-03-20 10:08:26 -0800
commite10e271bfd295bf805dc294460868e1deb938211 (patch)
treed2821657636e831e602f86baeabc3523a8e41285 /drivers/infiniband/hw/mthca
parentdc05980dd736bfbe5b2524b463e5f098e67a64e9 (diff)
IB/mthca: Correct reported SRQ size in MemFree case.
MemFree devices need to reserve one shared receive queue (SRQ) work request for internal use, so the capacity returned from the create_srq and query_srq methods should be srq->max - 1. Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 209d2bae225..96fcc64c61c 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -271,7 +271,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
srq->first_free = 0;
srq->last_free = srq->max - 1;
- attr->max_wr = srq->max;
+ attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max;
attr->max_sge = srq->max_gs;
return 0;
@@ -386,7 +386,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
} else
srq_attr->srq_limit = 0;
- srq_attr->max_wr = srq->max;
+ srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max;
srq_attr->max_sge = srq->max_gs;
out: