freenode
Kernel & Low-Level

mlx5 VFIO selftest lands after four days of Claude-assisted coding

Jason Gunthorpe submitted a 10-patch series that brings ConnectX DMA and MSI coverage to the kernel VFIO tests, cut from the usual multi-month effort.

Jason Gunthorpe has posted a 10-patch series adding an mlx5 ConnectX driver to the Linux kernel's VFIO self-test framework, work he says was largely produced with Claude assistance in about four days.

VFIO selftests exercise device assignment paths by driving real PCI hardware through userspace. Until now the suite lacked an mlx5 backend. The new driver programs both VFs and PFs over the command interface, boots the HCA through the usual enable and capability sequence, then uses an RDMA reliable-connected queue pair in force-loopback mode to issue RDMA WRITE operations that act as DMA memory copies. Completion events on those writes can also be armed to deliver MSI-X, covering the send_msi path the framework expects.

Gunthorpe notes that mlx5 device bring-up is unusually complex and that most of the new code is devoted to that boot sequence rather than the data path. Because mlx5 keeps a stable programming ABI, the same selftest should run from ConnectX-5 through current hardware, provided firmware supports QP loopback.

The development timeline is the sharper point. Prior VFIO selftest drivers have taken on the order of one to two months. Gunthorpe reports the series was coded by Claude Code across roughly 30 sessions and 4.5 million output tokens, with substantial human cleanup afterward. "Getting one in a week is pretty remarkable," he wrote. Supporting changes extract mlx5 interface macros and enums into headers the selftest can include without pulling in the full RDMA stack, and let drivers declare the DMA region size they need (about 18 MB for mlx5 firmware pages) instead of a fixed 2 MB ceiling.

David Matlack acked the main driver patches. The series targets the kernel selftests tree and the mlx5 IFC headers used by the in-kernel driver.