]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: drv-net: Test head-adjustment support
authorMohsin Bashir <mohsin.bashr@gmail.com>
Sat, 19 Jul 2025 08:30:59 +0000 (01:30 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Jul 2025 01:15:53 +0000 (18:15 -0700)
commitd6444ebc97dcbbc1e378bedb037380305294e77d
tree829c6aee1b1ea7b13ec191aaaedd387b1ef31e19
parent0b65cfcef9c5737eb2700aba20a93b8593f94c04
selftests: drv-net: Test head-adjustment support

Add test to validate the headroom adjustment support for both extension
and the shrinking cases. For the extension part, eat up space from
the start of payload data whereas, for the shrinking part, populate
the newly available space with a tag. In the user-space, validate that a
test string is manipulated accordingly.
The negative and positive offset values result in shrinking and growing of
headroom (growing and shrinking of payload) respectively.

TAP version 13
1..9
ok 1 xdp.test_xdp_native_pass_sb
ok 2 xdp.test_xdp_native_pass_mb
ok 3 xdp.test_xdp_native_drop_sb
ok 4 xdp.test_xdp_native_drop_mb
ok 5 xdp.test_xdp_native_tx_mb
\# Failed run: pkt_sz 512, ... offset 1. Reason: Adjustment failed
ok 6 xdp.test_xdp_native_adjst_tail_grow_data
ok 7 xdp.test_xdp_native_adjst_tail_shrnk_data
\# Failed run: pkt_sz 512, ... offset -128. Reason: Adjustment failed
ok 8 xdp.test_xdp_native_adjst_head_grow_data
\# Failed run: pkt_sz (512) > HDS threshold (0) and offset 64 > 48
ok 9 xdp.test_xdp_native_adjst_head_shrnk_data
\# Totals: pass:9 fail:0 xfail:0 xpass:0 skip:0 error:0

Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Link: https://patch.msgid.link/20250719083059.3209169-6-mohsin.bashr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/xdp.py
tools/testing/selftests/net/lib/xdp_native.bpf.c