From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Christian König" <christian.koenig@amd.com>
Cc: Zhiping Zhang <zhipingz@meta.com>,
Alex Williamson <alex@shazbot.org>,
Leon Romanovsky <leon@kernel.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
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>,
Linus Torvalds <torvalds@linuxfoundation.org>
Subject: Re: [PATCH v5 0/4] vfio/dma-buf: add TPH support for peer-to-peer access
Date: Mon, 1 Jun 2026 15:48:38 -0300 [thread overview]
Message-ID: <20260601184838.GE2487554@ziepe.ca> (raw)
In-Reply-To: <dedd8e8f-118c-4ee5-9552-cd2220dbdd23@amd.com>
On Mon, Jun 01, 2026 at 08:17:15PM +0200, Christian König wrote:
> On 6/1/26 19:47, Jason Gunthorpe wrote:
> > On Mon, Jun 01, 2026 at 11:59:55AM +0200, Christian König wrote:
> >>>> When you have a complete open source driver stack which utilizes
> >>>> VFIO passthrough as the interface to communicate with the kernel
> >>>> drivers then we can eventually talk about that.
> >>>
> >>> That decision is not up to dmabuf
> >>
> >> Yes it is. This is the DMA-buf API which is added here.
> >
> > It is a DMA-buf kernel API that is added, I think it is overreaching
> > to try to veto a VFIO uAPI that calls it..
>
> Well as long as that is a private interface between VFIO and mlx5 I
> have no objection at all.
Well, as you know, we are using dmabuf to mediate many of these
connections now.
I don't mind a "private" interface as a starting point, but it does
need to discoverable and negotiated without weird module dependencies
or symbol_gets.
> But when it starts to affect DMA-buf I need to make sure that it
> works for everybody. And without even being able to test it that
> becomes really tricky.
They should have an argument how it can be used for CPU backed memory,
IMHO.
> > This exposes a PCI SIG defined TPH capability in a reasonable simple
> > VFIO uAPI that can be re-used by any other device that happens to
> > support TPH on inbound MMIO. The uAPI has sensible general semantics
> > based around the PCI spec.
>
> That it's implementing an official PCI spec is a good argument.
>
> But on the other hand looking at the spec it's not really specifying
> much since everything is architecture specific.
Yeah, spec doesn't say what TPH does when it is received. It is
intended as an opaque channel between the source and target.
Even on the CPU DRAM side we make an opaque call into ACPI and the
BIOS returns back the right value to use for the CPU. The whole thing
is agressively opaque as to what the values mean to any particular
device.
So I don't have an issue with VFIO supplying a value for MMIO it
owns, it fits the general architecture.
> > Anyone can repeat the demonstration Meta outlined in their cover
> > letter: Use this new VFIO uAPI, import the DMABUF to mlx5, use a PCI
> > analyzer and you will see the PCI SIG defined TPH bits set the way the
> > VFIO uAPI says they should be set.
> >
> > There is nothing uniquely tied to Meta's device here, or unusable by
> > someone else's devices. Arguably this is actually a mlx5 feature to
> > allow VFIO to control its TPH generation HW.
>
> Would it be possible to demonstrate the functionality with some FPGA
> implementing an PCIe endpoint?
Sure, you don't even need a special endpoint, any endpoint that
doesn't explode when it receives a TPH is fine to illustrate that mlx5
is emitting it correctly.
A fpga reference board with an out of the box PCIe IP demo is likely
entirely sufficient, and you can use a FPGA logic analyzer to inspect
the packets.
Though keep in mind mlx5 is formally supporting TPH in a growing
number of kernel contexts, so we do test and verify our device is
working properly as an initiator. So I wouldn't advocate anyone
actually use their time on FPGA :)
> Doesn't needs to be anything funky, just the ability to exercise
> this for basically everybody who can spend a few $ on the HW.
Topologically you also probably need a PCIe switch as the CPU P2P
likely discards the header.
Jason
next prev parent reply other threads:[~2026-06-01 18:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260526144401.1485788-1-zhipingz@meta.com>
2026-05-27 6:55 ` [PATCH v5 0/4] vfio/dma-buf: add TPH support for peer-to-peer access Christian König
2026-05-27 12:14 ` Jason Gunthorpe
2026-05-27 12:23 ` Christian König
2026-05-27 12:36 ` Jason Gunthorpe
2026-05-27 12:53 ` Christian König
2026-05-28 4:55 ` Zhiping Zhang
2026-05-28 7:46 ` Christian König
2026-05-29 6:34 ` Zhiping Zhang
2026-05-29 7:36 ` Christian König
2026-05-29 20:11 ` Jason Gunthorpe
2026-06-01 9:59 ` Christian König
2026-06-01 17:47 ` Jason Gunthorpe
2026-06-01 18:17 ` Christian König
2026-06-01 18:48 ` Jason Gunthorpe [this message]
2026-05-29 20:31 ` Keith Busch
2026-06-01 10:03 ` Christian König
2026-06-01 17:50 ` Jason Gunthorpe
[not found] ` <20260526144401.1485788-3-zhipingz@meta.com>
2026-05-27 6:57 ` [PATCH v5 2/4] dma-buf: add optional get_tph() callback Christian König
2026-05-27 17:03 ` Alex Williamson
[not found] ` <20260526144401.1485788-4-zhipingz@meta.com>
2026-05-27 18:06 ` [PATCH v5 3/4] vfio/pci: implement get_tph and DMA_BUF_TPH feature Alex Williamson
2026-05-28 5:34 ` Zhiping Zhang
[not found] ` <20260526144401.1485788-2-zhipingz@meta.com>
2026-05-27 20:53 ` [PATCH v5 1/4] PCI/TPH: expose the enabled TPH requester type Alex Williamson
2026-05-28 5:35 ` Zhiping Zhang
2026-05-28 8:04 ` fengchengwen
2026-05-29 6:41 ` Zhiping Zhang
[not found] ` <20260526144401.1485788-5-zhipingz@meta.com>
2026-05-27 19:00 ` [PATCH v5 4/4] RDMA/mlx5: get tph for p2p access when registering dma-buf mr Alex Williamson
2026-05-28 5:54 ` Zhiping Zhang
2026-05-27 22:55 ` Michael Gur
2026-05-28 6:07 ` 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=20260601184838.GE2487554@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=alex@shazbot.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=helgaas@kernel.org \
--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=torvalds@linuxfoundation.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