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.
Patch 1 exposes the enabled TPH requester type through a small PCI/TPH helper so callers don't reach into pci_dev internals. Patch 2 adds the optional dma_buf_ops::get_tph callback to the dma-buf framework so importers can fetch TPH metadata from an exporter. Patch 3 implements get_tph in vfio-pci and adds the new uAPI (VFIO_DEVICE_FEATURE_DMA_BUF_TPH) for userspace to attach the metadata. Patch 4 wires up the mlx5 RDMA driver as a consumer. Previous link: v4: https://lore.kernel.org/linux-pci/[email protected]/ v3: https://lore.kernel.org/linux-pci/[email protected]/ v2: https://lore.kernel.org/linux-pci/[email protected]/ Zhiping Zhang (4): PCI/TPH: expose the enabled TPH requester type dma-buf: add optional get_tph() callback vfio/pci: implement get_tph and DMA_BUF_TPH feature RDMA/mlx5: get tph for p2p access when registering dma-buf mr drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 + drivers/infiniband/hw/mlx5/mr.c | 86 +++++++++++++- .../net/ethernet/mellanox/mlx5/core/lib/st.c | 28 +++-- drivers/pci/tph.c | 12 ++ drivers/vfio/pci/vfio_pci_core.c | 3 + drivers/vfio/pci/vfio_pci_dmabuf.c | 110 +++++++++++++++++- drivers/vfio/pci/vfio_pci_priv.h | 12 ++ include/linux/dma-buf.h | 21 ++++ include/linux/mlx5/driver.h | 7 ++ include/linux/pci-tph.h | 2 + include/uapi/linux/vfio.h | 37 ++++++ 11 files changed, 311 insertions(+), 13 deletions(-) -- 2.53.0-Meta
