diff options
| -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: |
