/kernel/linux/linux-6.6/tools/testing/selftests/bpf/map_tests/ |
H A D | map_percpu_stats.c | 21 static void map_info(int map_fd, struct bpf_map_info *info) in map_info() argument 28 ret = bpf_obj_get_info_by_fd(map_fd, info, &len); in map_info() 50 static __u32 map_count_elements(__u32 type, int map_fd) in map_count_elements() argument 55 while (!bpf_map_get_next_key(map_fd, &key, &key)) in map_count_elements() 62 static void delete_and_lookup_batch(int map_fd, void *keys, __u32 count) in delete_and_lookup_batch() argument 69 ret = bpf_map_lookup_and_delete_batch(map_fd, in delete_and_lookup_batch() 88 static void delete_all_elements(__u32 type, int map_fd, bool batch) in delete_all_elements() argument 99 for (n = 0; !bpf_map_get_next_key(map_fd, &key, &key); n++) in delete_all_elements() 107 delete_and_lookup_batch(map_fd, keys, n); in delete_all_elements() 114 ret = bpf_map_delete_elem(map_fd, key in delete_all_elements() 136 int map_fd; global() member 142 int map_fd; create_small_hash() local 237 check_expected_number_elements(__u32 n_inserted, int map_fd, struct bpf_map_info *info) check_expected_number_elements() argument 265 __test(int map_fd) __test() argument 308 int map_fd; map_create_opts() local [all...] |
H A D | sk_storage_map.c | 144 int btf_fd, map_fd; in create_sk_storage_map() local 151 map_fd = bpf_map_create(BPF_MAP_TYPE_SK_STORAGE, "sk_storage_map", 4, 8, 0, &map_opts); in create_sk_storage_map() 154 CHECK(map_fd == -1, in create_sk_storage_map() 157 return map_fd; in create_sk_storage_map() 166 int i, map_fd, err, *sk_fds; in insert_close_thread() local 181 map_fd = READ_ONCE(sk_storage_map); in insert_close_thread() 189 err = bpf_map_update_elem(map_fd, &sk_fds[i], &value, in insert_close_thread() 225 int i, map_fd = -1, err = 0, nr_threads_created = 0; in do_sk_storage_map_stress_free() local 246 map_fd = create_sk_storage_map(); in do_sk_storage_map_stress_free() 247 WRITE_ONCE(sk_storage_map, map_fd); in do_sk_storage_map_stress_free() 283 int map_fd = READ_ONCE(sk_storage_map); update_thread() local 307 int map_fd = READ_ONCE(sk_storage_map); delete_thread() local 331 int i, sk_fd, map_fd = -1, err = 0, nr_threads_created = 0; do_sk_storage_map_stress_change() local 463 int btf_fd, map_fd, sk_fd, err; test_sk_storage_map_basic() local [all...] |
H A D | htab_map_batch_ops.c | 14 static void map_batch_update(int map_fd, __u32 max_entries, int *keys, in map_batch_update() argument 37 err = bpf_map_update_batch(map_fd, keys, values, &max_entries, &opts); in map_batch_update() 81 int map_fd, *keys, *visited, key; in __test_map_lookup_and_delete_batch() local 92 map_fd = bpf_map_create(is_pcpu ? BPF_MAP_TYPE_PERCPU_HASH : BPF_MAP_TYPE_HASH, in __test_map_lookup_and_delete_batch() 94 CHECK(map_fd == -1, in __test_map_lookup_and_delete_batch() 109 err = bpf_map_lookup_and_delete_batch(map_fd, NULL, &batch, keys, in __test_map_lookup_and_delete_batch() 115 map_batch_update(map_fd, max_entries, keys, values, is_pcpu); in __test_map_lookup_and_delete_batch() 119 err = bpf_map_lookup_and_delete_batch(map_fd, NULL, &batch, keys, in __test_map_lookup_and_delete_batch() 127 err = bpf_map_lookup_and_delete_batch(map_fd, NULL, &batch, keys, in __test_map_lookup_and_delete_batch() 136 err = bpf_map_get_next_key(map_fd, NUL in __test_map_lookup_and_delete_batch() [all...] |
/kernel/linux/linux-5.10/samples/bpf/ |
H A D | test_map_in_map_user.c | 16 static int map_fd[7]; variable 18 #define PORT_A (map_fd[0]) 19 #define PORT_H (map_fd[1]) 20 #define REG_RESULT_H (map_fd[2]) 21 #define INLINE_RESULT_H (map_fd[3]) 22 #define A_OF_PORT_A (map_fd[4]) /* Test case #0 */ 23 #define H_OF_PORT_A (map_fd[5]) /* Test case #1 */ 24 #define H_OF_PORT_H (map_fd[6]) /* Test case #2 */ 147 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "port_a"); in main() 148 map_fd[ in main() [all...] |
H A D | test_lru_dist.c | 102 int map_fd; member 108 lru->map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, in pfect_lru_init() 112 assert(lru->map_fd != -1); in pfect_lru_init() 125 close(lru->map_fd); in pfect_lru_destroy() 136 if (!bpf_map_lookup_elem(lru->map_fd, &key, &node)) { in pfect_lru_lookup_or_insert() 153 bpf_map_update_elem(lru->map_fd, &node->key, &null_node, BPF_EXIST); in pfect_lru_lookup_or_insert() 161 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_EXIST)); in pfect_lru_lookup_or_insert() 164 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_NOEXIST)); in pfect_lru_lookup_or_insert() 210 int map_fd; in create_map() local 212 map_fd in create_map() 341 int map_fd; test_lru_loss0() local 392 int map_fd; test_lru_loss1() local 427 int map_fd = *(int *)data; do_test_parallel_lru_loss() local 470 int map_fd; test_parallel_lru_loss() local [all...] |
H A D | test_current_task_under_cgroup_user.c | 22 int map_fd[2]; in main() local 43 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "cgroup_map"); in main() 44 map_fd[1] = bpf_object__find_map_fd_by_name(obj, "perf_map"); in main() 45 if (map_fd[0] < 0 || map_fd[1] < 0) { in main() 65 if (bpf_map_update_elem(map_fd[0], &idx, &cg2, BPF_ANY)) { in main() 79 bpf_map_lookup_elem(map_fd[1], &idx, &remote_pid); in main() 93 bpf_map_update_elem(map_fd[1], &idx, &remote_pid, BPF_ANY); in main() 96 bpf_map_lookup_elem(map_fd[1], &idx, &remote_pid); in main()
|
/kernel/linux/linux-6.6/samples/bpf/ |
H A D | test_map_in_map_user.c | 17 static int map_fd[7]; variable 19 #define PORT_A (map_fd[0]) 20 #define PORT_H (map_fd[1]) 21 #define REG_RESULT_H (map_fd[2]) 22 #define INLINE_RESULT_H (map_fd[3]) 23 #define A_OF_PORT_A (map_fd[4]) /* Test case #0 */ 24 #define H_OF_PORT_A (map_fd[5]) /* Test case #1 */ 25 #define H_OF_PORT_H (map_fd[6]) /* Test case #2 */ 142 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "port_a"); in main() 143 map_fd[ in main() [all...] |
H A D | test_lru_dist.c | 96 int map_fd; member 102 lru->map_fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, in pfect_lru_init() 106 assert(lru->map_fd != -1); in pfect_lru_init() 119 close(lru->map_fd); in pfect_lru_destroy() 130 if (!bpf_map_lookup_elem(lru->map_fd, &key, &node)) { in pfect_lru_lookup_or_insert() 147 bpf_map_update_elem(lru->map_fd, &node->key, &null_node, BPF_EXIST); in pfect_lru_lookup_or_insert() 155 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_EXIST)); in pfect_lru_lookup_or_insert() 158 assert(!bpf_map_update_elem(lru->map_fd, &key, &node, BPF_NOEXIST)); in pfect_lru_lookup_or_insert() 207 int map_fd; in create_map() local 209 map_fd in create_map() 338 int map_fd; test_lru_loss0() local 389 int map_fd; test_lru_loss1() local 424 int map_fd = *(int *)data; do_test_parallel_lru_loss() local 467 int map_fd; test_parallel_lru_loss() local [all...] |
H A D | test_current_task_under_cgroup_user.c | 22 int map_fd[2]; in main() local 43 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "cgroup_map"); in main() 44 map_fd[1] = bpf_object__find_map_fd_by_name(obj, "perf_map"); in main() 45 if (map_fd[0] < 0 || map_fd[1] < 0) { in main() 65 if (bpf_map_update_elem(map_fd[0], &idx, &cg2, BPF_ANY)) { in main() 79 bpf_map_lookup_elem(map_fd[1], &idx, &remote_pid); in main() 93 bpf_map_update_elem(map_fd[1], &idx, &remote_pid, BPF_ANY); in main() 96 bpf_map_lookup_elem(map_fd[1], &idx, &remote_pid); in main()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
H A D | lookup_and_delete.c | 13 static int fill_values(int map_fd) in fill_values() argument 19 err = bpf_map_update_elem(map_fd, &key, &value, BPF_NOEXIST); in fill_values() 27 static int fill_values_percpu(int map_fd) in fill_values_percpu() argument 36 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in fill_values_percpu() 45 int *map_fd) in setup_prog() 66 *map_fd = bpf_map__fd(skel->maps.hash_map); in setup_prog() 67 if (!ASSERT_GE(*map_fd, 0, "bpf_map__fd")) in setup_prog() 102 int map_fd, err; in test_lookup_and_delete_hash() local 105 skel = setup_prog(BPF_MAP_TYPE_HASH, &map_fd); in test_lookup_and_delete_hash() 109 err = fill_values(map_fd); in test_lookup_and_delete_hash() 44 setup_prog(enum bpf_map_type map_type, int *map_fd) setup_prog() argument 138 int map_fd, err, i; test_lookup_and_delete_percpu_hash() local 178 int map_fd, err; test_lookup_and_delete_lru_hash() local 224 int map_fd, err, i, cpucnt = 0; test_lookup_and_delete_lru_percpu_hash() local [all...] |
H A D | global_data.c | 7 int i, err, map_fd; in test_global_data_number() local 10 map_fd = bpf_find_map(__func__, obj, "result_number"); in test_global_data_number() 11 if (CHECK_FAIL(map_fd < 0)) in test_global_data_number() 33 err = bpf_map_lookup_elem(map_fd, &tests[i].key, &num); in test_global_data_number() 42 int i, err, map_fd; in test_global_data_string() local 45 map_fd = bpf_find_map(__func__, obj, "result_string"); in test_global_data_string() 46 if (CHECK_FAIL(map_fd < 0)) in test_global_data_string() 62 err = bpf_map_lookup_elem(map_fd, &tests[i].key, str); in test_global_data_string() 77 int i, err, map_fd; in test_global_data_struct() local 80 map_fd in test_global_data_struct() 105 int err = -ENOMEM, map_fd, zero = 0; test_global_data_rdonly() local [all...] |
H A D | bpf_obj_pinning.c | 41 int map_fd = -1, map_fd2 = -1; in bpf_obj_pinning_detached() local 75 map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, map_name, 4, 4, 1, NULL); in bpf_obj_pinning_detached() 76 if (!ASSERT_GE(map_fd, 0, "map_fd")) in bpf_obj_pinning_detached() 82 err = bpf_obj_pin_opts(map_fd, map_name, &pin_opts); in bpf_obj_pinning_detached() 95 err = bpf_map_update_elem(map_fd, &zero, &src_value, 0); in bpf_obj_pinning_detached() 106 if (map_fd >= 0) in bpf_obj_pinning_detached() 107 ASSERT_OK(close(map_fd), "close_map_fd"); in bpf_obj_pinning_detached() 123 static void validate_pin(int map_fd, const char *map_name, int src_value, in validate_pin() argument 155 err = bpf_obj_pin_opts(map_fd, pin_pat in validate_pin() 183 validate_get(int map_fd, const char *map_name, int src_value, enum path_kind path_kind) validate_get() argument 247 int map_fd; bpf_obj_pinning_mounted() local [all...] |
H A D | tailcalls.c | 11 int err, map_fd, prog_fd, main_fd, i, j; in test_tailcall_1() local 40 map_fd = bpf_map__fd(prog_array); in test_tailcall_1() 41 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_1() 55 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 65 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 85 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 106 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 118 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 128 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 147 int err, map_fd, prog_f in test_tailcall_2() local 223 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_count() local 319 int err, map_fd, prog_fd, main_fd, data_fd, i; test_tailcall_4() local 409 int err, map_fd, prog_fd, main_fd, data_fd, i, key[] = { 1111, 1234, 5678 }; test_tailcall_5() local 499 int err, map_fd, prog_fd, main_fd, i; test_tailcall_bpf2bpf_1() local 583 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_bpf2bpf_2() local 663 int err, map_fd, prog_fd, main_fd, i; test_tailcall_bpf2bpf_3() local 757 int err, map_fd, prog_fd, main_fd, data_fd, i; test_tailcall_bpf2bpf_4() local 842 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_bpf2bpf_6() local [all...] |
H A D | l4lb_all.c | 26 int err, i, prog_fd, map_fd; in test_l4lb() local 41 map_fd = bpf_find_map(__func__, obj, "vip_map"); in test_l4lb() 42 if (map_fd < 0) in test_l4lb() 44 bpf_map_update_elem(map_fd, &key, &value, 0); in test_l4lb() 46 map_fd = bpf_find_map(__func__, obj, "ch_rings"); in test_l4lb() 47 if (map_fd < 0) in test_l4lb() 49 bpf_map_update_elem(map_fd, &ch_key, &real_num, 0); in test_l4lb() 51 map_fd = bpf_find_map(__func__, obj, "reals"); in test_l4lb() 52 if (map_fd < 0) in test_l4lb() 54 bpf_map_update_elem(map_fd, in test_l4lb() [all...] |
H A D | map_init.c | 20 static int map_populate(int map_fd, int num) in map_populate() argument 30 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in map_populate() 39 int *map_fd, int populate) in setup() 60 *map_fd = bpf_map__fd(skel->maps.hashmap1); in setup() 61 if (CHECK(*map_fd < 0, "bpf_map__fd", "failed\n")) in setup() 64 err = map_populate(*map_fd, populate); in setup() 71 close(*map_fd); in setup() 133 int map_fd, err; in test_pcpu_map_init() local 137 skel = setup(BPF_MAP_TYPE_PERCPU_HASH, 1, &map_fd, 1); in test_pcpu_map_init() 143 err = bpf_map_delete_elem(map_fd, in test_pcpu_map_init() 38 setup(enum bpf_map_type map_type, int map_sz, int *map_fd, int populate) setup() argument 173 int map_fd, err; test_pcpu_lru_map_init() local [all...] |
H A D | xdp_devmap_attach.c | 20 int err, dm_fd, map_fd; in test_xdp_with_devmap_helpers() local 37 map_fd = bpf_map__fd(skel->maps.dm_ports); in test_xdp_with_devmap_helpers() 43 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers() 46 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_devmap_helpers() 57 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers() 66 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers() 92 int err, dm_fd_frags, map_fd; in test_xdp_with_devmap_frags_helpers() local 100 map_fd = bpf_map__fd(skel->maps.dm_ports); in test_xdp_with_devmap_frags_helpers() 106 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_frags_helpers() 109 err = bpf_map_lookup_elem(map_fd, in test_xdp_with_devmap_frags_helpers() [all...] |
H A D | xdp_cpumap_attach.c | 19 int err, prog_fd, map_fd; in test_xdp_with_cpumap_helpers() local 35 map_fd = bpf_map__fd(skel->maps.cpu_map); in test_xdp_with_cpumap_helpers() 41 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers() 44 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_cpumap_helpers() 55 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers() 64 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers() 79 int err, frags_prog_fd, map_fd; in test_xdp_with_cpumap_frags_helpers() local 87 map_fd = bpf_map__fd(skel->maps.cpu_map); in test_xdp_with_cpumap_frags_helpers() 93 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers() 96 err = bpf_map_lookup_elem(map_fd, in test_xdp_with_cpumap_frags_helpers() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/map_tests/ |
H A D | sk_storage_map.c | 148 int btf_fd, map_fd; in create_sk_storage_map() local 155 map_fd = bpf_create_map_xattr(&xattr); in create_sk_storage_map() 158 CHECK(map_fd == -1, in create_sk_storage_map() 161 return map_fd; in create_sk_storage_map() 170 int i, map_fd, err, *sk_fds; in insert_close_thread() local 185 map_fd = READ_ONCE(sk_storage_map); in insert_close_thread() 193 err = bpf_map_update_elem(map_fd, &sk_fds[i], &value, in insert_close_thread() 229 int i, map_fd = -1, err = 0, nr_threads_created = 0; in do_sk_storage_map_stress_free() local 250 map_fd = create_sk_storage_map(); in do_sk_storage_map_stress_free() 251 WRITE_ONCE(sk_storage_map, map_fd); in do_sk_storage_map_stress_free() 287 int map_fd = READ_ONCE(sk_storage_map); update_thread() local 311 int map_fd = READ_ONCE(sk_storage_map); delete_thread() local 335 int i, sk_fd, map_fd = -1, err = 0, nr_threads_created = 0; do_sk_storage_map_stress_change() local 467 int btf_fd, map_fd, sk_fd, err; test_sk_storage_map_basic() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
H A D | test_lpm_map.c | 428 int map_fd; in test_lpm_delete() local 434 map_fd = bpf_create_map(BPF_MAP_TYPE_LPM_TRIE, in test_lpm_delete() 437 assert(map_fd >= 0); in test_lpm_delete() 454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -1 && in test_lpm_delete() 479 assert(bpf_map_delete_elem(map_fd, key) == -1 && in test_lpm_delete() 484 assert(bpf_map_delete_elem(map_fd, ke in test_lpm_delete() 541 int map_fd; test_lpm_get_next_key() local 695 int map_fd; global() member 740 setup_lpm_mt_test_info(struct lpm_mt_test_info *info, int map_fd) setup_lpm_mt_test_info() argument 759 int i, map_fd; test_lpm_multi_thread() local [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/ |
H A D | test_lpm_map.c | 428 int map_fd; in test_lpm_delete() local 434 map_fd = bpf_map_create(BPF_MAP_TYPE_LPM_TRIE, NULL, in test_lpm_delete() 437 assert(map_fd >= 0); in test_lpm_delete() 454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete() 474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT); in test_lpm_delete() 478 assert(bpf_map_delete_elem(map_fd, key) == -ENOENT); in test_lpm_delete() 482 assert(bpf_map_delete_elem(map_fd, ke in test_lpm_delete() 538 int map_fd; test_lpm_get_next_key() local 685 int map_fd; global() member 730 setup_lpm_mt_test_info(struct lpm_mt_test_info *info, int map_fd) setup_lpm_mt_test_info() argument 750 int i, map_fd; test_lpm_multi_thread() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
H A D | global_data.c | 7 int i, err, map_fd; in test_global_data_number() local 10 map_fd = bpf_find_map(__func__, obj, "result_number"); in test_global_data_number() 11 if (CHECK_FAIL(map_fd < 0)) in test_global_data_number() 33 err = bpf_map_lookup_elem(map_fd, &tests[i].key, &num); in test_global_data_number() 42 int i, err, map_fd; in test_global_data_string() local 45 map_fd = bpf_find_map(__func__, obj, "result_string"); in test_global_data_string() 46 if (CHECK_FAIL(map_fd < 0)) in test_global_data_string() 62 err = bpf_map_lookup_elem(map_fd, &tests[i].key, str); in test_global_data_string() 77 int i, err, map_fd; in test_global_data_struct() local 80 map_fd in test_global_data_struct() 105 int err = -ENOMEM, map_fd, zero = 0; test_global_data_rdonly() local [all...] |
H A D | tailcalls.c | 11 int err, map_fd, prog_fd, main_fd, i, j; in test_tailcall_1() local 36 map_fd = bpf_map__fd(prog_array); in test_tailcall_1() 37 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_1() 51 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 62 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 83 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 105 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 118 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 129 err = bpf_map_delete_elem(map_fd, &i); in test_tailcall_1() 149 int err, map_fd, prog_f in test_tailcall_2() local 227 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_3() local 305 int err, map_fd, prog_fd, main_fd, data_fd, i; test_tailcall_4() local 393 int err, map_fd, prog_fd, main_fd, data_fd, i, key[] = { 1111, 1234, 5678 }; test_tailcall_5() local 481 int err, map_fd, prog_fd, main_fd, i; test_tailcall_bpf2bpf_1() local 565 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_bpf2bpf_2() local 643 int err, map_fd, prog_fd, main_fd, i; test_tailcall_bpf2bpf_3() local 733 int err, map_fd, prog_fd, main_fd, data_fd, i, val; test_tailcall_bpf2bpf_4() local [all...] |
H A D | l4lb_all.c | 27 int err, i, prog_fd, map_fd; in test_l4lb() local 37 map_fd = bpf_find_map(__func__, obj, "vip_map"); in test_l4lb() 38 if (map_fd < 0) in test_l4lb() 40 bpf_map_update_elem(map_fd, &key, &value, 0); in test_l4lb() 42 map_fd = bpf_find_map(__func__, obj, "ch_rings"); in test_l4lb() 43 if (map_fd < 0) in test_l4lb() 45 bpf_map_update_elem(map_fd, &ch_key, &real_num, 0); in test_l4lb() 47 map_fd = bpf_find_map(__func__, obj, "reals"); in test_l4lb() 48 if (map_fd < 0) in test_l4lb() 50 bpf_map_update_elem(map_fd, in test_l4lb() [all...] |
H A D | map_init.c | 20 static int map_populate(int map_fd, int num) in map_populate() argument 30 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in map_populate() 39 int *map_fd, int populate) in setup() 60 *map_fd = bpf_map__fd(skel->maps.hashmap1); in setup() 61 if (CHECK(*map_fd < 0, "bpf_map__fd", "failed\n")) in setup() 64 err = map_populate(*map_fd, populate); in setup() 71 close(*map_fd); in setup() 133 int map_fd, err; in test_pcpu_map_init() local 137 skel = setup(BPF_MAP_TYPE_PERCPU_HASH, 1, &map_fd, 1); in test_pcpu_map_init() 143 err = bpf_map_delete_elem(map_fd, in test_pcpu_map_init() 38 setup(enum bpf_map_type map_type, int map_sz, int *map_fd, int populate) setup() argument 173 int map_fd, err; test_pcpu_lru_map_init() local [all...] |
/kernel/linux/linux-6.6/tools/lib/bpf/ |
H A D | ringbuf.c | 32 int map_fd; member 50 int map_fd; member 73 int ring_buffer__add(struct ring_buffer *rb, int map_fd, in ring_buffer__add() argument 86 err = bpf_map_get_info_by_fd(map_fd, &info, &len); in ring_buffer__add() 90 map_fd, err); in ring_buffer__add() 96 map_fd); in ring_buffer__add() 113 r->map_fd = map_fd; in ring_buffer__add() 119 tmp = mmap(NULL, rb->page_size, PROT_READ | PROT_WRITE, MAP_SHARED, map_fd, 0); in ring_buffer__add() 123 map_fd, er in ring_buffer__add() 183 ring_buffer__new(int map_fd, ring_buffer_sample_fn sample_cb, void *ctx, const struct ring_buffer_opts *opts) ring_buffer__new() argument 351 user_ringbuf_map(struct user_ring_buffer *rb, int map_fd) user_ringbuf_map() argument 421 user_ring_buffer__new(int map_fd, const struct user_ring_buffer_opts *opts) user_ring_buffer__new() argument [all...] |