linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: Fix outstanding_pi index for GSI qps
@ 2019-12-13  0:11 Prabhath Sajeepa
  2019-12-15 18:55 ` Leon Romanovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Prabhath Sajeepa @ 2019-12-13  0:11 UTC (permalink / raw)
  To: leon, dledford, jgg, linux-rdma, linux-kernel; +Cc: roland, psajeepa

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@purestorage.com>
---
 drivers/infiniband/hw/mlx5/gsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c
index ac4d8d1..1ae6fd9 100644
--- a/drivers/infiniband/hw/mlx5/gsi.c
+++ b/drivers/infiniband/hw/mlx5/gsi.c
@@ -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);
 		if (ret) {
 			/* Undo the effect of adding the outstanding wr */
-			gsi->outstanding_pi = (gsi->outstanding_pi - 1) %
-					      gsi->cap.max_send_wr;
+			gsi->outstanding_pi--;
 			goto err;
 		}
 		spin_unlock_irqrestore(&gsi->lock, flags);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-03 20:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13  0:11 [PATCH] IB/mlx5: Fix outstanding_pi index for GSI qps Prabhath Sajeepa
2019-12-15 18:55 ` Leon Romanovsky
     [not found]   ` <CAE=VkfD0Ywey6wW_rOZ=4qGyW347kTXH_MM17NvQhy6bkT=+tw@mail.gmail.com>
2019-12-16 17:51     ` Leon Romanovsky
2019-12-16 19:01   ` Prabhath Sajeepa
2019-12-18  6:00 ` Leon Romanovsky
2020-01-03 20:01 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).