diff options
| author | Paul Chaignon <paul.chaignon@gmail.com> | 2025-10-09 22:12:18 +0200 |
|---|---|---|
| committer | Martin KaFai Lau <martin.lau@kernel.org> | 2025-10-10 10:43:04 -0700 |
| commit | bc3eeb42597a514a0b5286f085d91c8b34e4a532 (patch) | |
| tree | f6bd442ece2caefa9b6f852d1c1976f0cc5ba75a /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | 8d45d0398d10966b022b96481feb619ae1695de0 (diff) | |
selftests/bpf: Test direct packet access on non-linear skbs
This patch adds new selftests in the direct packet access suite, to
cover the non-linear case. The first six tests cover the behavior of
the bounds check with a non-linear skb. The last test adds a call to
bpf_skb_pull_data() to be able to access the packet.
Note that the size of the linear area includes the L2 header, but for
some program types like cgroup_skb, ctx->data points to the L3 header.
Therefore, a linear area of 22 bytes will have only 8 bytes accessible
to the BPF program (22 - ETH_HLEN). For that reason, the cgroup_skb test
cases access the packet at an offset of 8 bytes.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/ceedbfd719e58f0d49dcceb8592f5e6bd38ce5fe.1760037899.git.paul.chaignon@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions
