rocm-ernic: Emulated RDMA NIC for Virtual Machines

rocm-ernic: Emulated RDMA NIC for Virtual Machines#

Introduction#

rocm-ernic is a userspace RDMA device server built on the libvfio-user framework. It provides full RDMA (Remote Direct Memory Access) functionality to virtual machines without requiring physical RDMA hardware or an in-guest software stack such as Soft-RoCE.

Key Features#

  • Full PCIe device emulation in userspace

  • An AMD Pensando ionic NIC, driven in the guest by the upstream Linux ionic and ionic_rdma drivers (see The ionic Device)

  • Memory-mapped BARs (MSI-X, registers, doorbells)

  • MSI-X interrupt support

  • Multiple RDMA backends (loopback, TCP/IP)

  • An in-process NVMe-oF target, so one VM and one server are a complete fabric (see NVMe-oF Controller)

  • An in-process S3-over-RDMA object store, with its own in-band HTTP endpoint on the emulated wire, so the same single VM is a complete object fabric (see S3 over RDMA Object Store)

  • Working Ethernet and TCP/IP to the host via a TAP interface

  • An optional P4 match-action stage on the emulated wire, matching the programmable datapath of the silicon the device models (see P4 Match-Action Engine)

  • Comprehensive statistics collection

Quick Start#

sudo apt install cmake meson ninja-build pkg-config \
  libibverbs-dev librdmacm-dev libglib2.0-dev libjson-c-dev
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build

./build/rocm-ernic \
  --socket /tmp/vfio-user-rocm-ernic.sock \
  --backend loopback --verbose

That presents the device to the guest as an upstream-driven ionic NIC. Add --tap to attach its Ethernet interface to a host TAP:

./build/rocm-ernic \
  --socket /tmp/vfio-user-rocm-ernic.sock \
  --backend loopback --tap ernic0

User Guide

Acknowledgments#

The RDMA device logic in src/pvrdma/ is adapted from the QEMU PVRDMA implementation. The original authors of that work:

License#

The build system, documentation, and the deployment and automation code are licensed under the MIT license. The emulator itself is GPL-2.0-or-later:

  • Everything under src/ and tests/, and the fuzz harnesses in nix/analysis/fuzz/, which build against src/.

  • The VMware/Linux uAPI header src/pvrdma/vmw_pvrdma-abi.h is instead dual GPL-2.0 / BSD-2-Clause.

The patches under ansible/files/patches/ modify the Linux ionic drivers and rdma-core’s ionic provider, and are licensed under the terms of the files they modify: mostly GPL-2.0 for the kernel drivers and GPL-2.0 OR Linux-OpenIB for rdma-core.

The groupings above are a summary; the per-file SPDX-License-Identifier notice is authoritative. See LICENSE.md for the full statement.