OSDN Git Service

selftests/bpf: Add C tests for kptr
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 24 Apr 2022 21:48:59 +0000 (03:18 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 26 Apr 2022 03:26:44 +0000 (20:26 -0700)
commit2cbc469a6fc345651569f9570b899af3b005cf80
treee9cab595cdfdbdc6e782af28e50dd38afed22b10
parentef89654f2bc7459f45b40be80de6cd3765ef8539
selftests/bpf: Add C tests for kptr

This uses the __kptr and __kptr_ref macros as well, and tries to test
the stuff that is supposed to work, since we have negative tests in
test_verifier suite. Also include some code to test map-in-map support,
such that the inner_map_meta matches the kptr_off_tab of map added as
element.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220424214901.2743946-12-memxor@gmail.com
tools/testing/selftests/bpf/prog_tests/map_kptr.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/map_kptr.c [new file with mode: 0644]