Netdev List
 help / color / mirror / Atom feed
From: Michael Gur <michaelgur@nvidia.com>
To: Zhiping Zhang <zhipingz@meta.com>,
	Alex Williamson <alex@shazbot.org>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Christian Konig <christian.koenig@amd.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	kvm@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-pci@vger.kernel.org, netdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Keith Busch <kbusch@kernel.org>,
	Yochai Cohen <yochai@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>
Subject: Re: [PATCH v7 5/5] RDMA/mlx5: get tph for p2p access when registering dma-buf mr
Date: Thu, 11 Jun 2026 15:44:26 +0300	[thread overview]
Message-ID: <4dc9ad01-97ce-4c97-9c8d-189822da53b2@nvidia.com> (raw)
In-Reply-To: <20260610193158.2614209-6-zhipingz@meta.com>


On 6/10/2026 10:31 PM, Zhiping Zhang wrote:
> Query dma-buf TPH metadata when registering a dma-buf MR for peer-to-
> peer access to a PCIe endpoint and use it to program requester-side TPH
> on the outbound mkey. If the exporter has no metadata, fall back to the
> existing no-TPH path.
>
> For TPH-backed FRMRs, make the extra ST-table reference belong to the
> hardware mkey handle rather than the transient MR object. Extend the
> FRMR pool API so reuse and final destroy can transfer and drop that ref
> at the handle lifetime boundaries, and add mlx5_st_get_index() to take
> a ref on an already-known ST index.
I'd keep the ST reference tied to MRs, where the ST is actually in use.
There's no functional need to couple ST refcounting to mkey lifetime.
Once an MR is destroyed and its mkey revoked, the mkey can no longer 
generate traffic, it's just an idle entry in the FRMR pool waiting to be 
aged out or reused.
This lets us drop all FRMR pool changes from this patch and keep a 
simple flow of 'acquire on MR create, release on MR destroy'.
> Also decode PH from kernel_vendor_key when recreating pooled mkeys so
> the requester hint matches the pool key.
I've fixed that in a series I've sent earlier this week, please rebase 
next version on top of it.

Thanks,
Michael
> Signed-off-by: Zhiping Zhang <zhipingz@meta.com>
> ---
>   drivers/infiniband/core/frmr_pools.c          |  20 +++-
>   drivers/infiniband/hw/mlx5/mr.c               | 111 +++++++++++++++++-
>   .../net/ethernet/mellanox/mlx5/core/lib/st.c  |  49 ++++++--
>   include/linux/mlx5/driver.h                   |  12 ++
>   include/rdma/frmr_pools.h                     |   5 +-
>   5 files changed, 178 insertions(+), 19 deletions(-)

  parent reply	other threads:[~2026-06-11 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260610193158.2614209-1-zhipingz@meta.com>
     [not found] ` <20260610193158.2614209-2-zhipingz@meta.com>
2026-06-11  7:47   ` [PATCH v7 1/5] net/mlx5: free mlx5_st_idx_data on final dealloc Christian König
2026-06-11 22:53     ` Zhiping Zhang
2026-06-11 23:45       ` Zhiping Zhang
     [not found] ` <20260610193158.2614209-4-zhipingz@meta.com>
2026-06-11 10:35   ` [PATCH v7 3/5] dma-buf: add optional get_tph() callback Christian König
2026-06-11 23:07     ` Zhiping Zhang
     [not found] ` <20260610193158.2614209-6-zhipingz@meta.com>
2026-06-11 12:44   ` Michael Gur [this message]
2026-06-11 23:09     ` [PATCH v7 5/5] RDMA/mlx5: get tph for p2p access when registering dma-buf mr Zhiping Zhang
2026-06-11 16:11 [PATCH v7 0/5] vfio/dma-buf: add TPH support for peer-to-peer access Zhiping Zhang
2026-06-11 16:11 ` [PATCH v7 5/5] RDMA/mlx5: get tph for p2p access when registering dma-buf mr Zhiping Zhang

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=4dc9ad01-97ce-4c97-9c8d-189822da53b2@nvidia.com \
    --to=michaelgur@nvidia.com \
    --cc=alex@shazbot.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=helgaas@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kbusch@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=yishaih@nvidia.com \
    --cc=yochai@nvidia.com \
    --cc=zhipingz@meta.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