]> www.infradead.org Git - users/dwmw2/linux.git/commit
vhost_net: Add self test with tun device vhost-net
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 22 Jun 2021 16:03:09 +0000 (17:03 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 24 Jun 2021 12:19:50 +0000 (13:19 +0100)
commitdb4e518d0e8883a52868d549e0b1e0a1be5bd656
treee84c5a5866f07baad2343b276ad99dcf46108d37
parente71b98ee8458ef39aa2fef2c0349beaf0645a96e
vhost_net: Add self test with tun device

This creates a tun device and brings it up, and finds out the link-local
address that the kernel automatically assigns to it. It then sets up
vhost-net on the tun device, uses that to send a ping to the kernel's
assigned link-local addresss, and waits for a reply.

If everything is working correctly, it will get a response and manage to
understand it. If the virtio_net_hdr and other pieces are not working as
expected, then it fails (and times out after 1 second).

The test is repeated in various combinations of vhost-net feature flags,
tun vhdr length, PI enabled, and XDP/non-XDP code paths. Most of which
didn't work before the patch series that added this test, but do now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
tools/testing/selftests/Makefile
tools/testing/selftests/vhost/Makefile [new file with mode: 0644]
tools/testing/selftests/vhost/config [new file with mode: 0644]
tools/testing/selftests/vhost/test_vhost_net.c [new file with mode: 0644]