]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Add test for XDP metadata support in tun driver
authorMarcus Wichelmann <marcus.wichelmann@hetzner-cloud.de>
Wed, 5 Mar 2025 21:34:37 +0000 (21:34 +0000)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 6 Mar 2025 20:31:08 +0000 (12:31 -0800)
commit73eeecc3cdfeb098f8859269b608589b8a919686
tree72a694cb6db0624eeed00318ca0c07e9a9010e95
parentb46aa22b66d3283d2b312269dd5f17e6637f02a4
selftests/bpf: Add test for XDP metadata support in tun driver

Add a selftest that creates a tap device, attaches XDP and TC programs,
writes a packet with a test payload into the tap device and checks the
test result. This test ensures that the XDP metadata support in the tun
driver is enabled and that the metadata size is correctly passed to the
skb.

See the previous commit ("selftests/bpf: refactor xdp_context_functional
test and bpf program") for details about the test design.

The test runs in its own network namespace. This provides some extra
safety against conflicting interface names.

Signed-off-by: Marcus Wichelmann <marcus.wichelmann@hetzner-cloud.de>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250305213438.3863922-6-marcus.wichelmann@hetzner-cloud.de
tools/testing/selftests/bpf/prog_tests/xdp_context_test_run.c