This patchset adds support for non-linear skbs when running tc programs with BPF_PROG_TEST_RUN. We've had multiple bugs in the past few years in Cilium caused by missing calls to bpf_skb_pull_data(). Daniel suggested this new BPF_PROG_TEST_RUN flag as a way to uncover these bugs in our BPF tests. Changes in v2: - Made the linear size configurable via ctx->data_end, as suggested by Amery. - Reworked the selftests to allow testing the configurable linear size. - Fix warnings reported by kernel test robot on first commit. - Rebased. Paul Chaignon (4): bpf: Refactor cleanup of bpf_prog_test_run_skb bpf: Craft non-linear skbs in BPF_PROG_TEST_RUN selftests/bpf: Support non-linear flag in test loader selftests/bpf: Test direct packet access on non-linear skbs include/uapi/linux/bpf.h | 4 + net/bpf/test_run.c | 120 ++++++++++++------ tools/include/uapi/linux/bpf.h | 4 + tools/testing/selftests/bpf/progs/bpf_misc.h | 4 + .../bpf/progs/verifier_direct_packet_access.c | 54 ++++++++ tools/testing/selftests/bpf/test_loader.c | 20 ++- 6 files changed, 168 insertions(+), 38 deletions(-) -- 2.43.0