2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/tools/testing/selftests/bpf/map_tests
Anton Protopopov 6c1b8cb6a7 selftests/bpf: test map percpu stats
Add a new map test, map_percpu_stats.c, which is checking the correctness of
map's percpu elements counters.  For supported maps the test upserts a number
of elements, checks the correctness of the counters, then deletes all the
elements and checks again that the counters sum drops down to zero.

The following map types are tested:

    * BPF_MAP_TYPE_HASH, BPF_F_NO_PREALLOC
    * BPF_MAP_TYPE_PERCPU_HASH, BPF_F_NO_PREALLOC
    * BPF_MAP_TYPE_HASH,
    * BPF_MAP_TYPE_PERCPU_HASH,
    * BPF_MAP_TYPE_LRU_HASH
    * BPF_MAP_TYPE_LRU_PERCPU_HASH
    * BPF_MAP_TYPE_LRU_HASH, BPF_F_NO_COMMON_LRU
    * BPF_MAP_TYPE_LRU_PERCPU_HASH, BPF_F_NO_COMMON_LRU
    * BPF_MAP_TYPE_HASH_OF_MAPS

Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Acked-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230706133932.45883-6-aspsk@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-07-06 12:42:25 -07:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
array_map_batch_ops.c selftests/bpf: Free the allocated resources after test case succeeds 2022-09-22 16:41:27 -07:00
htab_map_batch_ops.c selftests/bpf: Free the allocated resources after test case succeeds 2022-09-22 16:41:27 -07:00
lpm_trie_map_batch_ops.c selftests/bpf: Free the allocated resources after test case succeeds 2022-09-22 16:41:27 -07:00
map_in_map_batch_ops.c selftests/bpf: Use bpf_{btf,link,map,prog}_get_info_by_fd() 2023-02-16 15:32:46 -08:00
map_percpu_stats.c selftests/bpf: test map percpu stats 2023-07-06 12:42:25 -07:00
sk_storage_map.c bpf: Set and check spin lock value in sk_storage_map_test 2022-11-21 11:45:38 -08:00
task_storage_map.c selftests/bpf: Destroy the skeleton when CONFIG_PREEMPT is off 2022-09-22 16:41:27 -07:00