[ofa-general] [PATCH] libmlx4: max_recv_wr must be non-zero for non-SRQ QPs
Jack Morgenstein
jackm at dev.mellanox.co.il
Wed Nov 28 02:44:20 PST 2007
max_recv_wr must also be non-zero for QPs which are not
associated with an SRQ.
Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>
---
Roland,
Without this patch, if the userspace caller specifies max_recv_wr = 0 for a non-srq
QP, the creation will be rejected in kernel space in file
infiniband/hw/mlx4/qp.c, procedure set_rq_size:
} else {
/* HW requires >= 1 RQ entry with >= 1 gather entry */
==> NOTE: if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
return -EINVAL;
You've set max_recv_sge size to 1, but not max_recv_wr.
Jack
diff --git a/src/verbs.c b/src/verbs.c
index 4e7beff..ec4c6a5 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -367,8 +367,12 @@ struct ibv_qp *mlx4_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
if (attr->srq)
attr->cap.max_recv_wr = qp->rq.wqe_cnt = 0;
- else if (attr->cap.max_recv_sge < 1)
- attr->cap.max_recv_sge = 1;
+ else {
+ if (attr->cap.max_recv_sge < 1)
+ attr->cap.max_recv_sge = 1;
+ if (attr->cap.max_recv_wr < 1)
+ attr->cap.max_recv_wr = 1;
+ }
if (mlx4_alloc_qp_buf(pd, &attr->cap, attr->qp_type, qp))
goto err;
More information about the general
mailing list