]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: drv-net: xdp: Add rss_hash metadata tests
authorChris J Arges <carges@cloudflare.com>
Wed, 25 Mar 2026 20:09:52 +0000 (15:09 -0500)
committerJakub Kicinski <kuba@kernel.org>
Sun, 29 Mar 2026 21:09:08 +0000 (14:09 -0700)
commite3cdf6cf5fc6db0643723083e2c70fffe098e249
treeea41c65c0f80df73d1b412e890dec902da86efb8
parent4ce06406958b67fdddcc2e6948237dd6ff6ba112
selftests: drv-net: xdp: Add rss_hash metadata tests

This test loads xdp_metadata.bpf which calls bpf_xdp_metadata_rx_hash() on
incoming packets. The metadata from that packet is then sent to a BPF
map for validation. It borrows structure from xdp.py, reusing common
functions.

The test checks the device's xdp-rx-metadata-features via netlink
before running and skips on devices that do not advertise hash support.
This can be run on veth devices as well as real hardware.

The test is fairly simple and just verifies that a TCP or UDP packet can be
identified as an L4 flow. This minimal test also passes if run on a veth
device.

Signed-off-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20260325201139.2501937-7-carges@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/Makefile
tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
tools/testing/selftests/drivers/net/hw/xdp_metadata.py [new file with mode: 0644]
tools/testing/selftests/net/lib/xdp_metadata.bpf.c [new file with mode: 0644]