Commit b5671afe authored by Prabhath Sajeepa's avatar Prabhath Sajeepa Committed by Jason Gunthorpe

IB/mlx5: Fix outstanding_pi index for GSI qps

Commit b0ffeb53 ("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: b0ffeb53 ("IB/mlx5: Fix iteration overrun in GSI qps")
Link: https://lore.kernel.org/r/1576195889-23527-1-git-send-email-psajeepa@purestorage.comSigned-off-by: default avatarPrabhath Sajeepa <psajeepa@purestorage.com>
Acked-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 58fb0b56
...@@ -507,8 +507,7 @@ int mlx5_ib_gsi_post_send(struct ib_qp *qp, const struct ib_send_wr *wr, ...@@ -507,8 +507,7 @@ int mlx5_ib_gsi_post_send(struct ib_qp *qp, const struct ib_send_wr *wr,
ret = ib_post_send(tx_qp, &cur_wr.wr, bad_wr); ret = ib_post_send(tx_qp, &cur_wr.wr, bad_wr);
if (ret) { if (ret) {
/* Undo the effect of adding the outstanding wr */ /* Undo the effect of adding the outstanding wr */
gsi->outstanding_pi = (gsi->outstanding_pi - 1) % gsi->outstanding_pi--;
gsi->cap.max_send_wr;
goto err; goto err;
} }
spin_unlock_irqrestore(&gsi->lock, flags); spin_unlock_irqrestore(&gsi->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment