Re: [PATCH] IB/mlx5: Fix outstanding_pi index for GSI qps

From: Leon Romanovsky
Date: Wed Dec 18 2019 - 01:00:46 EST


On Thu, Dec 12, 2019 at 05:11:29PM -0700, Prabhath Sajeepa wrote:
> b0ffeb537f3a changed the way how outstanding WRs are tracked for GSI QP. But the
> fix did not cover the case when a call to ib_post_send fails and index
> to track outstanding WRs need to be updated correctly.
>
> Fixes: b0ffeb537f3a ('IB/mlx5: Fix iteration overrun in GSI qps ')
> Signed-off-by: Prabhath Sajeepa <psajeepa@xxxxxxxxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx5/gsi.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

The description of this patch is better to be updated to include the
fact that outstanding_ci holds unwrapped version of outstanding_pi and
current code will generate wrong loop inside generate_completions(), due
to breaking assumption that outstanding_ci < outstanding_pi:

79 for (index = gsi->outstanding_ci; index != gsi->outstanding_pi;
80 index++) {

Thanks,
Acked-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>