From: sashiko-bot@kernel.org
To: "Jacob Moroni" <jmoroni@google.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH RESEND rdma-next 2/2] RDMA/irdma: Do not change mr->pd in driver during rereg_mr
Date: Thu, 29 Oct 2026 14:37:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-189536@kernel.org> (raw)
In-Reply-To: <20261029141849.1575012-2-jmoroni@google.com>
> Previously, IB_MR_REREG_PD would cause the driver to set
> iwmr->ibmr.pd to the new PD before reregistering with HW because
> irdma_hwreg_mr() retrieves the PD from there.
>
> ib_uverbs_rereg_mr() only moves the PD usecnt from the old PD to
> the new one and updates mr->pd itself after the driver's
> rereg_user_mr() call succeeds.
>
> So, if the rereg_user_mr() call fails, the MR is left pointing at
> a PD that does not account for it while the old PD keeps the reference,
> which means the old PD can never be deallocated, while the new PD can
> be deallocated even though the MR still points at it.
>
> Fix this by removing the PD update from the driver and just letting
> the core handle it. This required plumbing the PD as an argument
> through a few functions. This works because the core passes the
> PD unconditionally and provides the current PD if IB_MR_REREG_PD is
> not set.
>
> Fixes: 5ac388db27c4 ("RDMA/irdma: Add support to re-register a memory region")
> Signed-off-by: Jacob Moroni <jmoroni@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029141849.1575012-1-jmoroni@google.com?part=2
next prev parent reply other threads:[~2026-10-29 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 14:18 [PATCH RESEND rdma-next 1/2] RDMA/irdma: Do not allow rereg_mr to revive defunct MRs Jacob Moroni
2026-10-29 14:18 ` [PATCH RESEND rdma-next 2/2] RDMA/irdma: Do not change mr->pd in driver during rereg_mr Jacob Moroni
2026-10-29 14:37 ` sashiko-bot [this message]
2026-10-29 14:31 ` [PATCH RESEND rdma-next 1/2] RDMA/irdma: Do not allow rereg_mr to revive defunct MRs 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=sashiko-outbox-189536@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jmoroni@google.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.