aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/cq.c
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2013-10-31 15:26:35 +0200
committerRoland Dreier <roland@purestorage.com>2013-11-15 10:24:17 -0800
commit93b80ac297b1cfdf3bea771a5ce6ea4ff5d25d1d (patch)
treec8cb81c349cb9740b358b9670ecbe5fb8904aa35 /drivers/infiniband/hw/mlx4/cq.c
parentLinux 3.12-rc7 (diff)
downloadlinux-dev-93b80ac297b1cfdf3bea771a5ce6ea4ff5d25d1d.tar.xz
linux-dev-93b80ac297b1cfdf3bea771a5ce6ea4ff5d25d1d.zip
IB/mlx4: Fix endless loop in resize CQ
When calling get_sw_cqe() we need pass the consumer_index and not the masked value. Failure to do so will cause incorrect result of get_sw_cqe() possibly leading to endless loop. This problem was reported and analyzed by Michael Rice from HP. Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/cq.c')
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index d5e60f44ba5a..3fe1a68a500a 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -324,7 +324,7 @@ static int mlx4_ib_get_outstanding_cqes(struct mlx4_ib_cq *cq)
u32 i;
i = cq->mcq.cons_index;
- while (get_sw_cqe(cq, i & cq->ibcq.cqe))
+ while (get_sw_cqe(cq, i))
++i;
return i - cq->mcq.cons_index;