Skip to content

Commit ad0716a

Browse files
pspure78gregkh
authored andcommitted
IB/mlx5: Fix outstanding_pi index for GSI qps
commit b5671af upstream. Commit b0ffeb5 ("IB/mlx5: Fix iteration overrun in GSI qps") changed the way outstanding WRs are tracked for the GSI QP. But the fix did not cover the case when a call to ib_post_send() fails and updates index to track outstanding. Since the prior commmit outstanding_pi should not be bounded otherwise the loop generate_completions() will fail. Fixes: b0ffeb5 ("IB/mlx5: Fix iteration overrun in GSI qps") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Prabhath Sajeepa <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3e4ab15 commit ad0716a

File tree

1 file changed

+1
-2
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+1
-2
lines changed

drivers/infiniband/hw/mlx5/gsi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,7 @@ int mlx5_ib_gsi_post_send(struct ib_qp *qp, struct ib_send_wr *wr,
507507
ret = ib_post_send(tx_qp, &cur_wr.wr, bad_wr);
508508
if (ret) {
509509
/* Undo the effect of adding the outstanding wr */
510-
gsi->outstanding_pi = (gsi->outstanding_pi - 1) %
511-
gsi->cap.max_send_wr;
510+
gsi->outstanding_pi--;
512511
goto err;
513512
}
514513
spin_unlock_irqrestore(&gsi->lock, flags);

0 commit comments

Comments
 (0)