[ofa-general] [PATCH] IB/mlx4: rq size computation fix

Jack Morgenstein jackm at dev.mellanox.co.il
Sun Jun 3 06:43:20 PDT 2007


rq.max should be at least 1.

Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index dc137de..0d5baf5 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -196,7 +196,7 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
 	    cap->max_recv_sge > dev->dev->caps.max_rq_sg)
 		return -EINVAL;
 
-	qp->rq.max = cap->max_recv_wr ? roundup_pow_of_two(cap->max_recv_wr) : 0;
+	qp->rq.max = cap->max_recv_wr ? roundup_pow_of_two(cap->max_recv_wr) : 1;
 
 	qp->rq.wqe_shift = ilog2(roundup_pow_of_two(cap->max_recv_sge *
 						    sizeof (struct mlx4_wqe_data_seg)));



More information about the general mailing list