On 2026-07-16 02:03 PM, Jason Gunthorpe wrote: > Add an mlx5 ConnectX selftest driver that programs VFs and PFs > through the command interface. Create the driver skeleton with > probe(), the command interface, HCA boot sequence, and all resource > allocation up through ALLOC_PD + CREATE_MKEY. > > The driver implements vfio_pci_driver_ops (probe/init/remove) and > registers with the VFIO selftest framework. It matches the same > mlx5 ConnectX device IDs that the kernel matches. > > init() brings the HCA to a running state: > - Command interface setup (two-slot: regular + async pages) > - ENABLE_HCA -> SET_ISSI -> QUERY/MANAGE_PAGES -> SET_HCA_CAP -> > INIT_HCA > - EQ creation (CMD + PAGE_REQUEST events for PF support) > - ALLOC_PD, CREATE_MKEY (PA-mode, covers all IOVAs) > - Force-loopback capability check > > remove() tears down in reverse order through TEARDOWN_HCA and > DISABLE_HCA, including async pages slot drain and FW page reclaim. > > The driver region (~18MB) holds all HW-visible DMA buffers (command > queue, mailboxes, EQ, FW pages) overlaid as a single struct on > device->driver.region.vaddr. > > Data path ops (memcpy_start/memcpy_wait) are left as stubs for the > next patch. > > Assisted-by: Claude:claude-opus-4.6 > Signed-off-by: Jason Gunthorpe <[email protected]>
Acked-by: David Matlack <[email protected]>
