From: Zhiping Zhang <zhipingz@meta.com>
To: Alex Williamson <alex@shazbot.org>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: Bjorn Helgaas <helgaas@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>,
Zhiping Zhang <zhipingz@meta.com>
Subject: [PATCH v2 0/2] vfio/dma-buf: add TPH support for peer-to-peer access
Date: Thu, 30 Apr 2026 13:06:55 -0700 [thread overview]
Message-ID: <20260430200704.352228-1-zhipingz@meta.com> (raw)
This series adds TLP Processing Hints (TPH) support to the VFIO dma-buf
export path, allowing importing drivers (e.g. mlx5) to use the exporter's
steering tag when performing peer-to-peer DMA into a VFIO-owned device.
Changes since v1:
- VFIO_DEVICE_FEATURE_DMA_BUF is now unchanged — dma_ranges[],
__counted_by(nr_ranges), and flags==0 are all preserved
- Added a new VFIO_DEVICE_FEATURE_DMA_BUF_TPH (feature 13) as a separate
SET ioctl that takes a dmabuf fd, validates it belongs to this vfio
device, and stores the steering tag + processing hint under memory_lock
- Kept the dma_buf_ops.get_tph callback as the general exporter-side
interface for importing drivers
Patch 1 adds the dma-buf get_tph callback and the new vfio uAPI.
Patch 2 wires up the mlx5 RDMA driver as a consumer.
Previous links:
https://lore.kernel.org/linux-pci/20260324234615.3731237-1-zhipingz@meta.com/
https://lore.kernel.org/dri-devel/20260420183920.3626389-1-zhipingz@meta.com/
Zhiping Zhang (2):
vfio: add dma-buf get_tph callback and DMA_BUF_TPH feature
RDMA/mlx5: get tph for p2p access when registering dma-buf mr
drivers/infiniband/hw/mlx5/mr.c | 38 +++++++
drivers/net/ethernet/mellanox/mlx5/core/lib/st.c | 25 +++--
drivers/vfio/pci/vfio_pci_core.c | 3 +
drivers/vfio/pci/vfio_pci_dmabuf.c | 65 ++++++++++++
drivers/vfio/pci/vfio_pci_priv.h | 11 ++
include/linux/dma-buf.h | 17 +++
include/linux/mlx5/driver.h | 7 ++
include/uapi/linux/vfio.h | 22 ++++
8 files changed, 180 insertions(+), 8 deletions(-)
--
2.47.1
next reply other threads:[~2026-04-30 20:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 20:06 Zhiping Zhang [this message]
2026-04-30 20:06 ` [PATCH v2 1/2] vfio: add dma-buf get_tph callback and DMA_BUF_TPH feature Zhiping Zhang
2026-05-04 21:44 ` Alex Williamson
2026-05-05 6:54 ` Zhiping Zhang
2026-05-06 6:58 ` fengchengwen
2026-05-06 18:23 ` Zhiping Zhang
2026-04-30 20:06 ` [PATCH v2 2/2] RDMA/mlx5: get tph for p2p access when registering dma-buf mr Zhiping Zhang
2026-05-06 7:04 ` fengchengwen
2026-05-06 18:13 ` 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=20260430200704.352228-1-zhipingz@meta.com \
--to=zhipingz@meta.com \
--cc=alex@shazbot.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=helgaas@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kbusch@kernel.org \
--cc=leon@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yishaih@nvidia.com \
--cc=yochai@nvidia.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