[ofa-general] [PATCH 1/2] libmlx4: fix SRQ buffer allocation

Eli Cohen eli at mellanox.co.il
Wed Jun 6 05:40:19 PDT 2007


Roland,
this patch and the complementary subsequent patch were not actually
checked since the version I was working against is different than you
"for-2.6.22" branch. But I did check this on against our build and it
seems to work.

Fix receive buffer allocation for SRQ QPs.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>

---

diff --git a/src/verbs.c b/src/verbs.c
index 1feae9d..b800eb2 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -373,6 +373,13 @@ struct ibv_qp *mlx4_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr)
 		return NULL;
 
 	qp->sq.max = align_queue_size(pd->context, attr->cap.max_send_wr, 0);
+
+	if (attr->srq)
+		attr->cap.max_recv_wr = 0;
+	else
+		attr->cap.max_recv_wr = attr->cap.max_recv_wr ?
+			attr->cap.max_recv_wr : 1;
+
 	qp->rq.max = align_queue_size(pd->context, attr->cap.max_recv_wr, 0);
 
 	if (mlx4_alloc_qp_buf(pd, &attr->cap, attr->qp_type, qp))




More information about the general mailing list