selftests/bpf: Test the update operations for htab of maps
authorHou Tao <houtao1@huawei.com>
Wed, 6 Nov 2024 06:35:42 +0000 (14:35 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 11 Nov 2024 16:18:39 +0000 (08:18 -0800)
commitcb55657c7fc800b722f2ef0afaf4d9c3c8902e6d
treecf7f2072ebf35aa8175ba275776068439022afee
parent503cfb103c8d6ca4f23a9abbf36672c9cfe6f745
selftests/bpf: Test the update operations for htab of maps

Add test cases to verify the following four update operations on htab of
maps don't trigger lockdep warning:

(1) add then delete
(2) add, overwrite, then delete
(3) add, then lookup_and_delete
(4) add two elements, then lookup_and_delete_batch

Test cases are added for pre-allocated and non-preallocated htab of maps
respectively.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20241106063542.357743-4-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
tools/testing/selftests/bpf/prog_tests/map_in_map.c
tools/testing/selftests/bpf/progs/update_map_in_htab.c [new file with mode: 0644]