diff options
author | Dotan Barak <dotanb@mellanox.co.il> | 2006-03-20 13:08:26 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-20 13:08:26 -0500 |
commit | e10e271bfd295bf805dc294460868e1deb938211 (patch) | |
tree | d2821657636e831e602f86baeabc3523a8e41285 /drivers | |
parent | dc05980dd736bfbe5b2524b463e5f098e67a64e9 (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')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 4 |
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 209d2bae2256..96fcc64c61cd 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, | |||
271 | srq->first_free = 0; | 271 | srq->first_free = 0; |
272 | srq->last_free = srq->max - 1; | 272 | srq->last_free = srq->max - 1; |
273 | 273 | ||
274 | attr->max_wr = srq->max; | 274 | attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; |
275 | attr->max_sge = srq->max_gs; | 275 | attr->max_sge = srq->max_gs; |
276 | 276 | ||
277 | return 0; | 277 | return 0; |
@@ -386,7 +386,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) | |||
386 | } else | 386 | } else |
387 | srq_attr->srq_limit = 0; | 387 | srq_attr->srq_limit = 0; |
388 | 388 | ||
389 | srq_attr->max_wr = srq->max; | 389 | srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; |
390 | srq_attr->max_sge = srq->max_gs; | 390 | srq_attr->max_sge = srq->max_gs; |
391 | 391 | ||
392 | out: | 392 | out: |