Re: [PATCH 00/11] mlx5 support for VFIO self test

David Matlack
2026-05-01T16:11:41Z

On Thu, Apr 30, 2026 at 5:08 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> Add an mlx5 driver to VFIO self test. This is largely a remix of the
> existing VFIO mlx5 driver in rdma-core. It uses an RDMA loopback QP
> to issue RDMA WRITE operations which effectively perform memory
> copies using DMA. Since mlx5 has a stable programming ABI this
> should work on devices from CX5 to current HW. The device FW must
> support the QP loopback configuration.

> This entire series was coded by Claude Code in about 4 days.

Very exciting. Josh Hilke from Google is also working on using AI to
create a selftest driver for Intel IGB NICs so VFIO selftests can run
in QEMU [1]. So it's encouraging to see you were able to do it with
mlx5.

[1] https://www.qemu.org/docs/master/system/devices/igb.html

> For those interested, the flow I used was broadly a prompt sequence
> sort of like:
>
> - Hey Claude, go look at the falcon series, VFIO self test, the
> mlx5 driver, rdma-core and some PDF documentation and make a
> plan to put mlx5 under the selftest.
> - Write an rdma-core application using the built-in VFIO provider
> that can do the required memcpy operations that vfio selftests
> wants.
> (This resulted in a 1k loc C file that compiled and ran the
> first time but had a few bugs related to device programming
> that the AI resolved.)
> - Replace the rdma-core components with open-coded versions to
> create a fully stand-alone program that does the DMA memcpy.
> - Review and audit the thing.
> [Pause and de-slop it]
> - Make it work on a PF too (this is surprisingly hard!).

Can it work on CX VFs? We're interested in continuously performing
memory copies across a Live Update using a VF via selftests to
demonstrate SR-IOV preservation (when we eventually get there).

> [Move to a kernel tree and copy all the .md files and .c program
> it made]
> - Hey Claude, look at all this stuff and make a broad plan to
> actually build a VFIO self test.
> - Here is my 1 sentence advice on what each patch should look
> like, make a detailed plan to make a patch for every one.
> [Pause and polish the patch plans]
> - Execute plan X then commit it [pause and de-slop each patch,
> repeat].
> [Review and final polish]
>
> It is based on a tree with the falcon series applied.

Thanks for sending, I look forward to reviewing!