summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/drivers/net/hw/lib
diff options
context:
space:
mode:
authorChris J Arges <carges@cloudflare.com>2026-03-25 15:09:52 -0500
committerJakub Kicinski <kuba@kernel.org>2026-03-29 14:09:08 -0700
commite3cdf6cf5fc6db0643723083e2c70fffe098e249 (patch)
treeea41c65c0f80df73d1b412e890dec902da86efb8 /tools/testing/selftests/drivers/net/hw/lib
parent4ce06406958b67fdddcc2e6948237dd6ff6ba112 (diff)
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>
Diffstat (limited to 'tools/testing/selftests/drivers/net/hw/lib')
-rw-r--r--tools/testing/selftests/drivers/net/hw/lib/py/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
index b8d9ae282390..df4da5078c48 100644
--- a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
+++ b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
@@ -25,6 +25,7 @@ try:
from net.lib.py import bkg, cmd, bpftool, bpftrace, defer, ethtool, \
fd_read_timeout, ip, rand_port, rand_ports, wait_port_listen, \
wait_file, tool
+ from net.lib.py import bpf_map_set, bpf_map_dump, bpf_prog_map_ids
from net.lib.py import KsftSkipEx, KsftFailEx, KsftXfailEx
from net.lib.py import ksft_disruptive, ksft_exit, ksft_pr, ksft_run, \
ksft_setup, ksft_variants, KsftNamedVariant
@@ -40,6 +41,7 @@ try:
"bkg", "cmd", "bpftool", "bpftrace", "defer", "ethtool",
"fd_read_timeout", "ip", "rand_port", "rand_ports",
"wait_port_listen", "wait_file", "tool",
+ "bpf_map_set", "bpf_map_dump", "bpf_prog_map_ids",
"KsftSkipEx", "KsftFailEx", "KsftXfailEx",
"ksft_disruptive", "ksft_exit", "ksft_pr", "ksft_run",
"ksft_setup", "ksft_variants", "KsftNamedVariant",