selftests/bpf: Test bpf_xdp_pull_data
authorAmery Hung <ameryhung@gmail.com>
Mon, 22 Sep 2025 23:33:55 +0000 (16:33 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Tue, 23 Sep 2025 20:35:12 +0000 (13:35 -0700)
commit323302f54db92dc1c80ff5b114c20f19ec0adf81
tree76e286a7162afb7cbd4ce5345fdfc4cecb4e5349
parentfe9544ed1a2e9217b2c5285c3a4ac0dc5a38bd7b
selftests/bpf: Test bpf_xdp_pull_data

Test bpf_xdp_pull_data() with xdp packets with different layouts. The
xdp bpf program first checks if the layout is as expected. Then, it
calls bpf_xdp_pull_data(). Finally, it checks the 0xbb marker at offset
1024 using directly packet access.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250922233356.3356453-8-ameryhung@gmail.com
tools/testing/selftests/bpf/prog_tests/xdp_pull_data.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_xdp_pull_data.c [new file with mode: 0644]