The test suite requires a physical V80 to be present and the module to be loaded into a running kernel.
- A kernel built with
CONFIG_GCOV_KERNEL=y(only needed for coverage runs). lcovandgenhtmlinstalled (only needed for coverage runs).- The BDF identifier of the V80 card (e.g.
0000:03:00).- You may be able to retrieve the BDF identifier by running
v80-smi list
- You may be able to retrieve the BDF identifier by running
Build the module and the test suite:
make # builds slash.ko
make -C tests/ allLoad the module and rescan the PCI bus so the device nodes appear:
sudo insmod ./slash.ko
echo 1 | sudo tee /sys/bus/pci/rescan > /dev/nullRun the kselftest suite (must be run as root):
sudo make -C tests/ runThe suite produces TAP output. Each test fixture automatically tears down queue pairs on failure, so a failing test does not leave the device in a broken state.
The write_read_verify test defaults to DMA address 0x0. Set
SLASH_TEST_DMA_ADDR to use a different address:
sudo SLASH_TEST_DMA_ADDR=0x100000000 make -C tests/ runtest_module.sh automates the full build → load → test → coverage cycle:
./test_module.sh <BBBB:DD:FF>Replace <BBBB:DD:FF> with the BDF of the V80 (e.g. 0000:03:00).
The script:
- Checks that the running kernel has
CONFIG_GCOV_KERNEL=y. - Builds
slash.kowith gcov instrumentation (make GCOV=1). - Builds the test suite.
- Removes any currently-loaded
slashmodule. - Resets the gcov counters.
- Inserts the module and rescans the PCI bus.
- Runs the full kselftest suite.
- Removes the module.
- Captures coverage with
lcovand generates an HTML report incoverage/.
Open coverage/index.html in a browser to browse line-level coverage.