Re: [PATCH rdma-next 0/6] Add support for TLP emulation
From: Leon Romanovsky <leon@kernel.org>
Date: 2026-03-02 14:06:56
Also in:
linux-rdma, lkml
On Thu, Feb 26, 2026 at 05:34:34PM -0800, Jakub Kicinski wrote:
On Wed, 25 Feb 2026 16:19:30 +0200 Leon Romanovsky wrote:quoted
This series adds support for Transaction Layer Packet (TLP) emulation response gateway regions, enabling userspace device emulation software to write TLP responses directly to lower layers without kernel driver involvement. Currently, the mlx5 driver exposes VirtIO emulation access regions via the MLX5_IB_METHOD_VAR_OBJ_ALLOC ioctl. This series extends that ioctl to also support allocating TLP response gateway channels for PCI device emulation use cases.Why is this an RDMA thing if it's a PCIe feature indented for VirtIO?
This is the result of a long path of evolution. Early on, we had VDPA emulation implemented entirely within the RDMA stack. The idea was to build something similar to a tun/tap pair, where a native RDMA QP could be connected to RDMA QPs carrying WQEs formatted in the VirtIO layout. With some QEMU-side handling, this produced a virtio-net device. Later, this model was adapted for a DPU configuration. In that setup, the DPU's RDMA block held the native QPs, while the x86 host exposed the VirtIO-formatted QPs, still with QEMU involved. The DPU controlled the x86-side "tun/tap" through RDMA-linked operations on the associated objects. Next, the DPU evolved to instantiate a full VirtIO PCI function on its own, removing the need for x86 to run QEMU. The DPU continued to manage the tun/tap via RDMA operations, with some extensions to cover PCI- related details. Eventually, the DPU gained general-purpose programmable co-processors capable of executing various RDMA and non-RDMA operations. As a result, the RDMA subsystem also became responsible for loading programs onto these co-processors and managing them within RDMA context and PD security constraints. Now we have reached a stage where these co-processors can manage a much larger portion of the PCI-side behavior, including delegating some responsibilities back to the host CPU. This produces an odd situation where a privileged RDMA user can: - Claim an "emulation" PCI function - Load a co-processor program associated with that PCI function - Use RDMA-mediated queues and security controls to interact with the co-processor program - Use the co-processor and related mechanisms to capture and respond to TLPs directed to that PCI function There are many tightly coupled components in this design, but the TLP handling cannot be separated from the RDMA-related logic that enables it. Thanks