All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jacob Moroni <jmoroni@google.com>
Cc: tatyana.e.nikolova@intel.com, krzysztof.czurylo@intel.com,
	jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v2 3/5] RDMA/umem: Add pinned revocable dmabuf import interface
Date: Wed, 4 Mar 2026 16:46:38 +0200	[thread overview]
Message-ID: <20260304144638.GC12611@unreal> (raw)
In-Reply-To: <20260302001539.2275303-4-jmoroni@google.com>

On Mon, Mar 02, 2026 at 12:15:37AM +0000, Jacob Moroni wrote:
> Added an interface for importing a pinned but revocable dmabuf.
> This interface can be used by drivers that are capable of revocation
> so that they can import dmabufs from exporters that may require it,
> such as VFIO.
> 
> This interface implements a two step process, where drivers will first
> call ib_umem_dmabuf_get_pinned_revocable_and_lock() which will pin and
> map the dmabuf (and provide a functional move_notify/invalidate_mappings
> callback), but will return with the lock still held so that the
> driver can then populate the callback via
> ib_umem_dmabuf_set_revoke_locked() without races from concurrent
> revocations. This scheme also allows for easier integration with drivers
> that may not have actually allocated their internal MR objects at the time
> of the get_pinned_revocable* call.
> 
> Signed-off-by: Jacob Moroni <jmoroni@google.com>
> ---
>  drivers/infiniband/core/umem_dmabuf.c | 61 +++++++++++++++++++++++++++
>  include/rdma/ib_umem.h                | 20 +++++++++
>  2 files changed, 81 insertions(+)

<...>

> +void ib_umem_dmabuf_set_revoke_locked(struct ib_umem_dmabuf *umem_dmabuf,
> +				      void (*revoke)(void *priv), void *priv)
> +{
> +	dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv);
> +
> +	umem_dmabuf->pinned_revoke = revoke;
> +	umem_dmabuf->pinned_revoke_priv = priv;

I don't think that you need special priv, you can use umem_dmabuf->private instead.
See reg_user_mr_dmabuf():
 1680         umem_dmabuf->private = mr;

Everything else looks reasonable to me.

Thanks

  reply	other threads:[~2026-03-04 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02  0:15 [PATCH rdma-next v2 0/5] Add pinned revocable dmabuf import interface Jacob Moroni
2026-03-02  0:15 ` [PATCH rdma-next v2 1/5] RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helper Jacob Moroni
2026-03-02  0:15 ` [PATCH rdma-next v2 2/5] RDMA/umem: Move umem dmabuf revoke logic into helper function Jacob Moroni
2026-03-02  0:15 ` [PATCH rdma-next v2 3/5] RDMA/umem: Add pinned revocable dmabuf import interface Jacob Moroni
2026-03-04 14:46   ` Leon Romanovsky [this message]
2026-03-02  0:15 ` [PATCH rdma-next v2 4/5] RDMA/umem: Add helpers for umem dmabuf revoke lock Jacob Moroni
2026-03-02  0:15 ` [PATCH rdma-next v2 5/5] RDMA/irdma: Add support for revocable pinned dmabuf import Jacob Moroni

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=20260304144638.GC12611@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jmoroni@google.com \
    --cc=krzysztof.czurylo@intel.com \
    --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 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.