Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH rdma-next 1/2] RDMA/irdma: Wait for all refs to drop when destroying RoCE QPs
@ 2026-11-26 18:53 Jacob Moroni
  2026-11-26 18:53 ` [PATCH rdma-next 2/2] RDMA/irdma: Scrub software flush completions on QP destroy Jacob Moroni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jacob Moroni @ 2026-11-26 18:53 UTC (permalink / raw)
  To: tatyana.e.nikolova, jgg, leon; +Cc: linux-rdma, Jacob Moroni

Commit 6f52370970ac ("RDMA/irdma: Fix deadlock during netdev reset
with active connections") made QP destruction skip the refcount wait
if the device is being reset in order to fix a deadlock that could
occur for iWARP mode QPs due to refs still being held by the CM.

RoCE mode QPs are not subject to that issue and should still wait
for all of the references to be dropped. Otherwise, the QP could
be freed while the AEQ handler or disconnect work still holds a
reference, leading to a UAF. In RoCE mode, any remaining references
held by the AEQ handler/disconnect work are always transient so
the wait is bounded.

Fix this by restoring the original logic for RoCE QPs.

Fixes: 6f52370970ac ("RDMA/irdma: Fix deadlock during netdev reset with active connections")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index e07b6b40dd99..29ccd19da032 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -592,7 +592,7 @@ static void _irdma_destroy_qp(struct ib_qp *ibqp)
 	}
 
 	irdma_qp_rem_ref(&iwqp->ibqp);
-	if (!iwdev->rf->reset)
+	if (!iwdev->rf->reset || iwdev->roce_mode)
 		wait_for_completion(&iwqp->free_qp);
 	irdma_free_lsmm_rsrc(iwqp);
 	irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp);
-- 
2.56.1.839.g22a8290db9-goog


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

end of thread, other threads:[~2026-11-26 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 18:53 [PATCH rdma-next 1/2] RDMA/irdma: Wait for all refs to drop when destroying RoCE QPs Jacob Moroni
2026-11-26 18:53 ` [PATCH rdma-next 2/2] RDMA/irdma: Scrub software flush completions on QP destroy Jacob Moroni
2026-11-26 19:04 ` [PATCH rdma-next 1/2] RDMA/irdma: Wait for all refs to drop when destroying RoCE QPs sashiko-bot
2026-11-26 19:14   ` Jacob Moroni
2026-11-26 19:04 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox