diff options
author | Roland Dreier <roland@purestorage.com> | 2013-11-15 10:24:08 -0800 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-11-15 10:24:08 -0800 |
commit | 65585f680dc08d45d05f82320aab52c3d3221e82 (patch) | |
tree | 0e31503bfac56e067a355ee9b7fc01e3cfb0d928 | |
parent | bac599fc367bfb1313cc3e203112832eada818f3 (diff) | |
download | libmlx4-65585f680dc08d45d05f82320aab52c3d3221e82.tar.gz |
resize_cq: Fix possible endless loop scanning 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.
Based on a patch by Eli Cohen <eli@dev.mellanox.co.il> fixing the same
bug in the kernel.
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | src/cq.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -439,7 +439,7 @@ int mlx4_get_outstanding_cqes(struct mlx4_cq *cq) { uint32_t i; - for (i = cq->cons_index; get_sw_cqe(cq, (i & cq->ibv_cq.cqe)); ++i) + for (i = cq->cons_index; get_sw_cqe(cq, i); ++i) ; return i - cq->cons_index; |