IB/mlx5: Fix iteration overrun in GSI qps
authorSlava Shwartsman <slavash@mellanox.com>
Sun, 3 Jul 2016 12:28:19 +0000 (15:28 +0300)
committerDoug Ledford <dledford@redhat.com>
Tue, 2 Aug 2016 18:32:51 +0000 (14:32 -0400)
commitb0ffeb537f3a726931d962ab6d03e34a2f070ea4
tree2f5f86baf6b7f1cffcab3867c3060ee506390bd3
parent619615005e2f23e8f8b30142a074c005eb5aa063
IB/mlx5: Fix iteration overrun in GSI qps

Number of outstanding_pi may overflow and as a result may indicate that
there are no elements in the queue. The effect of doing this is that the
MAD layer will get stuck waiting for completions. The MAD layer will
think that the QP is full - because it didn't receive these completions.

This fix changes it so the outstanding_pi number is increased
with 32-bit wraparound and is not limited to max_send_wr so
that the difference between outstanding_pi and outstanding_ci will
really indicate the number of outstanding completions.

Cc: Stable <stable@vger.kernel.org>
Fixes: ea6dc2036224 ('IB/mlx5: Reorder GSI completions')
Signed-off-by: Slava Shwartsman <slavash@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/gsi.c