[PATCH v1 0/2] Retrieve TPH from dma-buf for PCIe P2P memory access

Zhiping Zhang
2026-04-20T18:44:42Z

Currently, TPH steering tags are derived for CPUs via ACPI. This series
extends the VFIO dma-buf path so a vfio-based accelerator can attach TPH
metadata to an exported dma-buf, and lets mlx5 consume that metadata
when registering a dma-buf MR for PCIe peer-to-peer access.

Patch 1 adds a dma-buf callback to retrieve raw TPH metadata and updates
VFIO_DEVICE_FEATURE_DMA_BUF to carry the optional steering tag and
processing hint in one extra trailing entries[] object without changing
the base uAPI layout. Patch 2 consumes the exported TPH metadata in mlx5
and converts the raw steering tag into an mlx5 steering-tag index.

Previous RFC link:
https://lore.kernel.org/linux-pci/20260324234615.3731237-1-zhipingz@meta.com/T/#u

Zhiping Zhang (2):
vfio: add callback to get tph info for dma-buf
RDMA/mlx5: get tph for p2p access when registering dma-buf mr

drivers/infiniband/hw/mlx5/mr.c | 38 ++++++++++++
.../net/ethernet/mellanox/mlx5/core/lib/st.c | 25 +++++---
drivers/vfio/pci/vfio_pci_dmabuf.c | 62 ++++++++++++++-----
include/linux/dma-buf.h | 17 +++++
include/linux/mlx5/driver.h | 7 +++
include/uapi/linux/vfio.h | 28 +++++++--
6 files changed, 151 insertions(+), 26 deletions(-)

--
2.52.0