From: Jacob Moroni <jmoroni@google.com>
To: tatyana.e.nikolova@intel.com, krzysztof.czurylo@intel.com,
jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, Jacob Moroni <jmoroni@google.com>
Subject: [PATCH rdma-next 0/4] Add pinned revocable dmabuf import interface
Date: Wed, 25 Feb 2026 21:07:01 +0000 [thread overview]
Message-ID: <20260225210705.373126-1-jmoroni@google.com> (raw)
Some dmabuf exporters (VFIO) will require that pinned importers support
revocation. In order to support this for non-ODP drivers/devices, a new
interface is required. This new interface implements a two step process
where the driver will perform a sequence like:
ib_umem_dmabuf_get_pinned_revocable_and_lock()
... Driver MR allocation/initialization/registration/etc
ib_umem_dmabuf_set_revoke_locked()
dma_resv_unlock();
This allows the driver to provide a callback that can be used to
perform the actual invalidation in a way that is safe against races
from concurrent revocations during initialization.
The driver must ensure that the HW will no longer access the region
before the revoke callback returns. For MRs, this can be achieved
by using the rereg capability to set the region length to 0, or
perhaps by moving the region to a new quarantine PD. For HW that
allows the driver to manage the keys (like irdma), this can be
achieved by deregistering the region in HW but not freeing the key
until the region is truly deregistered via ibv_dereg_mr.
Changes since RFC(s):
* Break the interface into a two step process to avoid needing
extra state in the driver.
* Move the majority of the functionality into the core.
RFC threads:
https://lore.kernel.org/linux-rdma/20260223195333.438492-1-jmoroni@google.com/T/#t
https://lore.kernel.org/linux-rdma/CAHYDg1TB1Xa+D700WrvrcQVdgZFE5f8iWp48EmQM9XjK9xJdew@mail.gmail.com/T/#t
Jacob Moroni (4):
RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helper
RDMA/umem: Move umem dmabuf revoke logic into helper function
RDMA/umem: Add pinned revocable dmabuf import interface
RDMA/irdma: Add support for revocable pinned dmabuf import
drivers/infiniband/core/umem_dmabuf.c | 122 ++++++++++++++++++++++----
drivers/infiniband/hw/irdma/main.h | 1 +
drivers/infiniband/hw/irdma/verbs.c | 71 ++++++++++++++-
include/rdma/ib_umem.h | 20 +++++
4 files changed, 195 insertions(+), 19 deletions(-)
--
2.53.0.414.gf7e9f6c205-goog
next reply other threads:[~2026-02-25 21:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 21:07 Jacob Moroni [this message]
2026-02-25 21:07 ` [PATCH rdma-next 1/4] RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helper Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 2/4] RDMA/umem: Move umem dmabuf revoke logic into helper function Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 3/4] RDMA/umem: Add pinned revocable dmabuf import interface Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 4/4] RDMA/irdma: Add support for revocable pinned dmabuf import Jacob Moroni
2026-02-26 8:55 ` Leon Romanovsky
2026-02-26 19:22 ` Jacob Moroni
2026-02-26 19:41 ` Leon Romanovsky
2026-02-26 21:38 ` Jacob Moroni
2026-02-27 14:44 ` Jacob Moroni
2026-02-27 14:50 ` Jason Gunthorpe
2026-02-27 14:53 ` Jason Gunthorpe
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=20260225210705.373126-1-jmoroni@google.com \
--to=jmoroni@google.com \
--cc=jgg@ziepe.ca \
--cc=krzysztof.czurylo@intel.com \
--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