projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43db2bc
)
IB/mthca: Fix SRQ limit event range check
author
Dotan Barak
<
[email protected]
>
Thu, 13 Jul 2006 08:05:49 +0000
(11:05 +0300)
committer
Roland Dreier
<
[email protected]
>
Mon, 24 Jul 2006 14:20:32 +0000
(07:20 -0700)
Mem-free HCAs always keep one spare SRQ WQE, so the SRQ limit cannot
be set beyond srq->max - 1.
Signed-off-by: Dotan Barak <
[email protected]
>
Signed-off-by: Michael S. Tsirkin <
[email protected]
>
Signed-off-by: Roland Dreier <
[email protected]
>
drivers/infiniband/hw/mthca/mthca_srq.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/mthca/mthca_srq.c
b/drivers/infiniband/hw/mthca/mthca_srq.c
index fab417c5cf43671f329b9b8c26dddc87bd9345ad..b60a9d79ae54ae569e7e7c765389c0ee05fd8260 100644
(file)
--- a/
drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/
drivers/infiniband/hw/mthca/mthca_srq.c
@@
-370,7
+370,8
@@
int mthca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
return -EINVAL;
if (attr_mask & IB_SRQ_LIMIT) {
- if (attr->srq_limit > srq->max)
+ u32 max_wr = mthca_is_memfree(dev) ? srq->max - 1 : srq->max;
+ if (attr->srq_limit > max_wr)
return -EINVAL;
mutex_lock(&srq->mutex);