Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93b80ac2 authored by Eli Cohen's avatar Eli Cohen Committed by Roland Dreier
Browse files

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: default avatarEli Cohen <eli@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 959f5854
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -324,7 +324,7 @@ static int mlx4_ib_get_outstanding_cqes(struct mlx4_ib_cq *cq)
	u32 i;
	u32 i;


	i = cq->mcq.cons_index;
	i = cq->mcq.cons_index;
	while (get_sw_cqe(cq, i & cq->ibcq.cqe))
	while (get_sw_cqe(cq, i))
		++i;
		++i;


	return i - cq->mcq.cons_index;
	return i - cq->mcq.cons_index;