Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jacob Moroni <jmoroni@google.com>
To: tatyana.e.nikolova@intel.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, Jacob Moroni <jmoroni@google.com>
Subject: [PATCH rdma-next 1/2] RDMA/irdma: Wait for all refs to drop when destroying RoCE QPs
Date: Thu, 26 Nov 2026 18:53:43 +0000	[thread overview]
Message-ID: <20261126185344.2784303-1-jmoroni@google.com> (raw)

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


             reply	other threads:[~2026-11-26 18:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 18:53 Jacob Moroni [this message]
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:04 ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261126185344.2784303-1-jmoroni@google.com \
    --to=jmoroni@google.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=tatyana.e.nikolova@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox