selftests/bpf: Add a test for using a cpumap from an freplace-to-XDP program
authorToke Høiland-Jørgensen <toke@redhat.com>
Wed, 14 Dec 2022 23:02:54 +0000 (00:02 +0100)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 15 Dec 2022 05:30:40 +0000 (21:30 -0800)
commitf506439ec3dee11e0e77b0a1f3fb3eec22c97873
tree0cc81e39a2b4c38f1fd9a393fcf59bab89fd79af
parent1c123c567fb138ebd187480b7fc0610fcb0851f5
selftests/bpf: Add a test for using a cpumap from an freplace-to-XDP program

This adds a simple test for inserting an XDP program into a cpumap that is
"owned" by an XDP program that was loaded as PROG_TYPE_EXT (as libxdp
does). Prior to the kernel fix this would fail because the map type
ownership would be set to PROG_TYPE_EXT instead of being resolved to
PROG_TYPE_XDP.

v5:
- Fix a few nits from Andrii, add his ACK
v4:
- Use skeletons for selftest
v3:
- Update comment to better explain the cause
- Add Yonghong's ACK

Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20221214230254.790066-2-toke@redhat.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
tools/testing/selftests/bpf/progs/freplace_progmap.c [new file with mode: 0644]