summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/map_kptr.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-12selftests/bpf: Add tests for kptr_ref refcountingKumar Kartikeya Dwivedi1-2/+104
Check at runtime how various operations for kptr_ref affect its refcount and verify against the actual count. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20220511194654.765705-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2022-04-26selftests/bpf: Add C tests for kptrKumar Kartikeya Dwivedi1-0/+190
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