Add pinned revocable dmabuf import interface
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 1 replyApplied
- v25 patches 1 replySuperseded
- v14 patches 7 repliesSuperseded
Changes in v3 from the cover letter
* Removed separate umem_dmabuf->pinned_revoke_priv field and used the existing private field instead.
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helperdrivers/ | +26 | 0 replies | |
| 2/5 | RDMA/umem: Move umem dmabuf revoke logic into helper functiondrivers/ | +17 | 0 replies | |
| 3/5 | RDMA/umem: Add pinned revocable dmabuf import interfacedrivers/ include/ | +80 | 0 replies | |
| 4/5 | RDMA/umem: Add helpers for umem dmabuf revoke lockdrivers/ include/ | +20 | 0 replies | |
| 5/5 | RDMA/irdma: Add support for revocable pinned dmabuf importdrivers/ | +93 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH rdma-next v3 0/5] Add pinned revocable dmabuf import interface
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()
ib_umem_dmabuf_revoke_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 in v3:
* Removed separate umem_dmabuf->pinned_revoke_priv field and used the existing private field instead.
Changes in v2:
* Created helpers for acquiring/releasing the umem_dmabuf revoke lock.
* Fixed rereg_user_mr handling in irdma to account for async revoke and used new revoke lock/unlock helper to simplify the dereg_mr path.
* Dropped unnecessary <linux/dma-resv.h> inclusion in irdma/main.h.
Changes in v1 (since RFCs):
* 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.
v2: https://lore.kernel.org/linux-rdma/[email protected]/T/#t
v1: https://lore.kernel.org/linux-rdma/[email protected]/T/#t
RFC v2: https://lore.kernel.org/linux-rdma/[email protected]/T/#t
RFC v1: https://lore.kernel.org/linux-rdma/CAHYDg1TB1Xa+D700WrvrcQVdgZFE5f8iWp48EmQM9XjK9xJdew@mail.gmail.com/T/#t
Jacob Moroni (5):
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/umem: Add helpers for umem dmabuf revoke lock RDMA/irdma: Add support for revocable pinned dmabuf import
drivers/infiniband/core/umem_dmabuf.c | 138 ++++++++++++++++++++++---- drivers/infiniband/hw/irdma/verbs.c | 105 +++++++++++++++++--- include/rdma/ib_umem.h | 23 +++++ 3 files changed, 236 insertions(+), 30 deletions(-)
Signature · 1 line
2.53.0.473.g4a7958ca14-goog