Lines Matching refs:map_flags
28 static int create_map(int map_type, int map_flags, unsigned int size) in create_map() argument
30 LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags); in create_map()
148 static void test_lru_sanity0(int map_type, int map_flags) in test_lru_sanity0() argument
155 map_flags); in test_lru_sanity0()
159 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity0()
160 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity0()
162 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity0()
239 static void test_lru_sanity1(int map_type, int map_flags, unsigned int tgt_free) in test_lru_sanity1() argument
247 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity1()
252 map_flags); in test_lru_sanity1()
260 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity1()
315 static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free) in test_lru_sanity2() argument
324 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity2()
329 map_flags); in test_lru_sanity2()
337 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity2()
422 static void test_lru_sanity3(int map_type, int map_flags, unsigned int tgt_free) in test_lru_sanity3() argument
430 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity3()
435 map_flags); in test_lru_sanity3()
443 lru_map_fd = create_map(map_type, map_flags, map_size); in test_lru_sanity3()
486 static void test_lru_sanity4(int map_type, int map_flags, unsigned int tgt_free) in test_lru_sanity4() argument
494 map_flags); in test_lru_sanity4()
498 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity4()
499 lru_map_fd = create_map(map_type, map_flags, in test_lru_sanity4()
502 lru_map_fd = create_map(map_type, map_flags, 3 * tgt_free); in test_lru_sanity4()
562 static void test_lru_sanity5(int map_type, int map_flags) in test_lru_sanity5() argument
568 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity5()
572 map_flags); in test_lru_sanity5()
574 map_fd = create_map(map_type, map_flags, 1); in test_lru_sanity5()
609 static void test_lru_sanity6(int map_type, int map_flags, int tgt_free) in test_lru_sanity6() argument
616 if (!(map_flags & BPF_F_NO_COMMON_LRU)) in test_lru_sanity6()
620 map_flags); in test_lru_sanity6()
627 lru_map_fd = create_map(map_type, map_flags, map_size * nr_cpus); in test_lru_sanity6()
676 static void test_lru_sanity7(int map_type, int map_flags) in test_lru_sanity7() argument
683 map_flags); in test_lru_sanity7()
687 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity7()
688 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity7()
690 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity7()
767 static void test_lru_sanity8(int map_type, int map_flags) in test_lru_sanity8() argument
774 map_flags); in test_lru_sanity8()
778 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity8()
779 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity8()
781 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity8()
853 int map_flags[] = {0, BPF_F_NO_COMMON_LRU}; in main() local
865 for (f = 0; f < ARRAY_SIZE(map_flags); f++) { in main()
866 unsigned int tgt_free = (map_flags[f] & BPF_F_NO_COMMON_LRU) ? in main()
870 test_lru_sanity0(map_types[t], map_flags[f]); in main()
871 test_lru_sanity1(map_types[t], map_flags[f], tgt_free); in main()
872 test_lru_sanity2(map_types[t], map_flags[f], tgt_free); in main()
873 test_lru_sanity3(map_types[t], map_flags[f], tgt_free); in main()
874 test_lru_sanity4(map_types[t], map_flags[f], tgt_free); in main()
875 test_lru_sanity5(map_types[t], map_flags[f]); in main()
876 test_lru_sanity6(map_types[t], map_flags[f], tgt_free); in main()
877 test_lru_sanity7(map_types[t], map_flags[f]); in main()
878 test_lru_sanity8(map_types[t], map_flags[f]); in main()