Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: fengchengwen <fengchengwen@huawei.com>
To: Zhiping Zhang <zhipingz@meta.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Michael Guralnik <michaelgur@nvidia.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Christian Konig <christian.koenig@amd.com>,
	Alex Williamson <alex@shazbot.org>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: <kvm@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
	<linux-pci@vger.kernel.org>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v13 5/5] RDMA/mlx5: get tph for p2p access when registering dma-buf mr
Date: Thu, 24 Sep 2026 09:13:49 +0800	[thread overview]
Message-ID: <f4ff7ced-63b6-42e6-8e01-9f01d2e59843@huawei.com> (raw)
In-Reply-To: <20260731211601.3033906-6-zhipingz@meta.com>

Hi Zhiping,

On 8/1/2026 5:15 AM, Zhiping Zhang wrote:
> Peer-to-peer DMA between a mlx5 NIC and a foreign PCIe endpoint
> (typically a GPU or a vfio-pci passthrough device) traverses the host
> PCIe fabric. The endpoint exporting the dma-buf knows which PCIe TLP
> Processing Hint (TPH) Steering Tag yields the best placement for the
> traffic it will sink: per-endpoint hint selection lets the root complex
> or switch direct DMA to a specific cache slice / NUMA node, cutting
> cross-socket snoop traffic and DRAM pressure under sustained p2p
> workloads.
> 
> Until now the mlx5 importer had no way to learn the exporter's chosen
> ST tag, so dma-buf MRs were registered without TPH and ran with the
> default (no-hint) routing. With dma_buf_get_pci_tph() in place this
> patch wires up mlx5_ib to query that metadata at MR registration time
> for p2p access 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 so behavior for non-TPH-aware exporters is unchanged.


While working on v21 of the VFIO PCIe TPH series, we got review
feedback that importers must add pci_p2pdma_distance() validation
before retrieving ST values from a dma-buf.

Your mlx5 patch follows the same importer pattern – it consumes
dma-buf TPH metadata. I think this patch should also include the
same distance check.

Thanks,
Chengwen


  parent reply	other threads:[~2026-09-24  1:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260731211601.3033906-1-zhipingz@meta.com>
2026-08-14 18:08 ` [PATCH v13 0/5] vfio/dma-buf: add TPH support for peer-to-peer access Zhiping Zhang
2026-09-02 20:53   ` Zhiping Zhang
2026-09-10 21:46     ` [PATCH v13 0/5] vfio/dma-buf: add TPH support for peer-to-peer access - ping Zhiping Zhang
2026-09-11  7:58       ` Christian König
2026-09-14 16:44         ` Zhiping Zhang
2026-09-15 20:49           ` Alex Williamson
2026-09-16  0:17             ` Zhiping Zhang
2026-09-15 11:37         ` Leon Romanovsky
2026-09-15 12:59           ` Christian König
2026-09-15 13:37             ` Leon Romanovsky
     [not found] ` <20260731211601.3033906-3-zhipingz@meta.com>
2026-08-03  1:21   ` [PATCH v13 2/5] PCI/TPH: Add requester/completer type helpers fengchengwen
2026-09-15 22:23   ` Bjorn Helgaas
2026-09-15 23:27     ` Zhiping Zhang
     [not found] ` <20260731211601.3033906-6-zhipingz@meta.com>
2026-09-23 19:11   ` [PATCH v13 5/5] RDMA/mlx5: get tph for p2p access when registering dma-buf mr Zhiping Zhang
2026-09-24  1:13   ` fengchengwen [this message]
2026-09-24  6:24     ` Zhiping Zhang
2026-09-24 23:30       ` Jason Gunthorpe
2026-09-25  6:17         ` Zhiping Zhang
2026-09-28 17:29           ` Jason Gunthorpe
2026-09-28 21:47             ` Zhiping Zhang
2026-09-30 12:13               ` Leon Romanovsky
2026-10-05 21:33                 ` 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=f4ff7ced-63b6-42e6-8e01-9f01d2e59843@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=alex@shazbot.org \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    --cc=kvm@vger.kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michaelgur@nvidia.com \
    --cc=sumit.semwal@linaro.org \
    --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