Home
last modified time | relevance | path

Searched refs:map_fd (Results 1 – 25 of 81) sorted by relevance

1234

/tools/testing/selftests/bpf/prog_tests/
A Dlookup_and_delete.c13 static int fill_values(int map_fd) in fill_values() argument
27 static int fill_values_percpu(int map_fd) in fill_values_percpu() argument
45 int *map_fd) in setup_prog() argument
102 int map_fd, err; in test_lookup_and_delete_hash() local
109 err = fill_values(map_fd); in test_lookup_and_delete_hash()
138 int map_fd, err, i; in test_lookup_and_delete_percpu_hash() local
145 err = fill_values_percpu(map_fd); in test_lookup_and_delete_percpu_hash()
178 int map_fd, err; in test_lookup_and_delete_lru_hash() local
185 err = fill_values(map_fd); in test_lookup_and_delete_lru_hash()
224 int map_fd, err, i, cpucnt = 0; in test_lookup_and_delete_lru_percpu_hash() local
[all …]
A Dl4lb_all.c26 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()
51 map_fd = bpf_find_map(__func__, obj, "reals"); in test_l4lb()
52 if (map_fd < 0) in test_l4lb()
75 map_fd = bpf_find_map(__func__, obj, "stats"); in test_l4lb()
76 if (map_fd < 0) in test_l4lb()
[all …]
A Dglobal_data.c7 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()
42 int i, err, map_fd; in test_global_data_string() local
46 if (CHECK_FAIL(map_fd < 0)) in test_global_data_string()
77 int i, err, map_fd; in test_global_data_struct() local
81 if (CHECK_FAIL(map_fd < 0)) in test_global_data_struct()
105 int err = -ENOMEM, map_fd, zero = 0; in test_global_data_rdonly() local
120 map_fd = bpf_map__fd(map); in test_global_data_rdonly()
121 if (CHECK_FAIL(map_fd < 0)) in test_global_data_rdonly()
[all …]
A Dmap_init.c20 static int map_populate(int map_fd, int num) in map_populate() argument
39 int *map_fd, int populate) in setup() argument
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
143 err = bpf_map_delete_elem(map_fd, &key); in test_pcpu_map_init()
153 err = bpf_map_lookup_elem(map_fd, &key, value); in test_pcpu_map_init()
173 int map_fd, err; in test_pcpu_lru_map_init() local
[all …]
A Dbpf_obj_pinning.c41 int map_fd = -1, map_fd2 = -1; in bpf_obj_pinning_detached() local
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()
155 err = bpf_obj_pin_opts(map_fd, pin_path, &pin_opts); in validate_pin()
193 err = bpf_obj_pin(map_fd, abs_path); in validate_get()
247 int map_fd; in bpf_obj_pinning_mounted() local
251 if (!ASSERT_GE(map_fd, 0, "map_fd")) in bpf_obj_pinning_mounted()
[all …]
A Dmap_lock.c23 int err, map_fd = *(u32 *) arg; in parallel_map_access() local
27 err = bpf_map_lookup_elem_flags(map_fd, &key, vars, BPF_F_LOCK); in parallel_map_access()
53 int prog_fd, map_fd[2], vars[17] = {}; in test_map_lock() local
64 map_fd[0] = bpf_find_map(__func__, obj, "hash_map"); in test_map_lock()
65 if (CHECK_FAIL(map_fd[0] < 0)) in test_map_lock()
67 map_fd[1] = bpf_find_map(__func__, obj, "array_map"); in test_map_lock()
68 if (CHECK_FAIL(map_fd[1] < 0)) in test_map_lock()
71 bpf_map_update_elem(map_fd[0], &key, vars, BPF_F_LOCK); in test_map_lock()
80 &map_fd[i - 4]))) in test_map_lock()
88 ret != (void *)&map_fd[i - 4])) in test_map_lock()
A Dtailcalls.c47 map_fd = bpf_map__fd(prog_array); in test_tailcall_1()
48 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_1()
184 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_2()
261 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_count()
445 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_4()
535 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_5()
623 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_bpf2bpf_1()
707 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_bpf2bpf_2()
787 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_bpf2bpf_3()
882 if (CHECK_FAIL(map_fd < 0)) in test_tailcall_bpf2bpf_4()
[all …]
A Dtask_local_storage.c90 int err, map_fd, prog_fd, task_fd; in test_recursion() local
117 map_fd = bpf_map__fd(skel->maps.map_a); in test_recursion()
123 map_fd = bpf_map__fd(skel->maps.map_b); in test_recursion()
258 int map_fd, parent_task_fd, ev_fd; in test_uptr_basic() local
280 map_fd = bpf_map__fd(skel->maps.datamap); in test_uptr_basic()
380 int err, task_fd, map_fd; in test_uptr_across_pages() local
398 map_fd = bpf_map__fd(skel->maps.datamap); in test_uptr_across_pages()
419 int err, task_fd, map_fd; in test_uptr_update_failure() local
463 int map_fd, err; in test_uptr_map_failure() local
482 if (ASSERT_ERR_FD(map_fd, "map_create")) in test_uptr_map_failure()
[all …]
A Dxdp_cpumap_attach.c21 int err, prog_fd, prog_redir_fd, map_fd; in test_xdp_with_cpumap_helpers() local
41 map_fd = bpf_map__fd(skel->maps.cpu_map); in test_xdp_with_cpumap_helpers()
47 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers()
50 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_cpumap_helpers()
81 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers()
90 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers()
107 int err, frags_prog_fd, map_fd; in test_xdp_with_cpumap_frags_helpers() local
115 map_fd = bpf_map__fd(skel->maps.cpu_map); in test_xdp_with_cpumap_frags_helpers()
121 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers()
124 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_cpumap_frags_helpers()
[all …]
A Dlegacy_printk.c9 int err, zero = 0, my_pid = getpid(), res, map_fd; in execute_one_variant() local
24 map_fd = bpf_map__fd(skel->maps.my_pid_map); in execute_one_variant()
25 err = bpf_map_update_elem(map_fd, &zero, &my_pid, BPF_ANY); in execute_one_variant()
28 err = bpf_map_lookup_elem(map_fd, &zero, &res); in execute_one_variant()
40 map_fd = bpf_map__fd(skel->maps.res_map); in execute_one_variant()
41 err = bpf_map_lookup_elem(map_fd, &zero, &res); in execute_one_variant()
A Dxdp_devmap_attach.c24 int err, dm_fd, dm_fd_redir, map_fd; in test_xdp_with_devmap_helpers() local
45 map_fd = bpf_map__fd(skel->maps.dm_ports); in test_xdp_with_devmap_helpers()
51 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers()
54 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_devmap_helpers()
81 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers()
90 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers()
118 int err, dm_fd_frags, map_fd; in test_xdp_with_devmap_frags_helpers() local
126 map_fd = bpf_map__fd(skel->maps.dm_ports); in test_xdp_with_devmap_frags_helpers()
135 err = bpf_map_lookup_elem(map_fd, &idx, &val); in test_xdp_with_devmap_frags_helpers()
189 map_fd = bpf_map__fd(skel->maps.dm_ports); in test_xdp_with_devmap_helpers_veth()
[all …]
A Dcgroup_attach_multi.c11 static int map_fd = -1; variable
17 if (map_fd < 0) in prog_load_cnt()
19 if (map_fd < 0) { in prog_load_cnt()
44 BPF_LD_MAP_FD(BPF_REG_1, map_fd), in prog_load_cnt()
151 CHECK_FAIL(bpf_map_lookup_elem(map_fd, &key, &value)); in serial_test_cgroup_attach_multi()
188 CHECK_FAIL(bpf_map_update_elem(map_fd, &key, &value, 0)); in serial_test_cgroup_attach_multi()
190 CHECK_FAIL(bpf_map_lookup_elem(map_fd, &key, &value)); in serial_test_cgroup_attach_multi()
241 CHECK_FAIL(bpf_map_update_elem(map_fd, &key, &value, 0)); in serial_test_cgroup_attach_multi()
243 CHECK_FAIL(bpf_map_lookup_elem(map_fd, &key, &value)); in serial_test_cgroup_attach_multi()
258 CHECK_FAIL(bpf_map_lookup_elem(map_fd, &key, &value)); in serial_test_cgroup_attach_multi()
[all …]
A Dxdp.c16 int err, prog_fd, map_fd; in test_xdp() local
29 map_fd = bpf_find_map(__func__, obj, "vip2tnl"); in test_xdp()
30 if (map_fd < 0) in test_xdp()
32 bpf_map_update_elem(map_fd, &key4, &value4, 0); in test_xdp()
33 bpf_map_update_elem(map_fd, &key6, &value6, 0); in test_xdp()
A Dsyscall.c10 int map_fd; member
39 ASSERT_GT(ctx.map_fd, 0, "ctx.map_fd"); in test_syscall_load_prog()
44 err = bpf_map_lookup_elem(ctx.map_fd, &key, &value); in test_syscall_load_prog()
51 if (ctx.map_fd > 0) in test_syscall_load_prog()
52 close(ctx.map_fd); in test_syscall_load_prog()
A Dsk_storage_omem_uncharge.c12 int sk_fd = -1, map_fd, err, value; in test_sk_storage_omem_uncharge() local
18 map_fd = bpf_map__fd(skel->maps.sk_storage); in test_sk_storage_omem_uncharge()
33 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); in test_sk_storage_omem_uncharge()
38 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); in test_sk_storage_omem_uncharge()
A Dglobal_func_args.c9 int err, i, map_fd, actual_value; in test_global_func_args0() local
12 map_fd = bpf_find_map(__func__, obj, map_name); in test_global_func_args0()
13 if (CHECK(map_fd < 0, "bpf_find_map", "cannot find BPF map %s: %s\n", in test_global_func_args0()
33 err = bpf_map_lookup_elem(map_fd, &i, &actual_value); in test_global_func_args0()
/tools/testing/selftests/bpf/map_tests/
A Dmap_percpu_stats.c108 delete_and_lookup_batch(map_fd, keys, n); in delete_all_elements()
115 ret = bpf_map_delete_elem(map_fd, keyp); in delete_all_elements()
143 int map_fd; member
150 int map_fd; in create_small_hash() local
156 return map_fd; in create_small_hash()
292 static void __test(int map_fd) in __test() argument
295 .map_fd = map_fd, in __test()
299 map_info(map_fd, &info); in __test()
334 close(map_fd); in __test()
342 int map_fd; in map_create_opts() local
[all …]
A Dsk_storage_map.c144 int btf_fd, map_fd; in create_sk_storage_map() local
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
253 close(map_fd); in do_sk_storage_map_stress_free()
254 map_fd = -1; in do_sk_storage_map_stress_free()
271 if (map_fd != -1) in do_sk_storage_map_stress_free()
272 close(map_fd); in do_sk_storage_map_stress_free()
379 close(map_fd); in do_sk_storage_map_stress_change()
463 int btf_fd, map_fd, sk_fd, err; in test_sk_storage_map_basic() local
[all …]
A Dlpm_trie_map_get_next_key.c27 int map_fd; member
41 bpf_map_get_next_key(ctx->map_fd, &ctx->key, &next_key); in get_next_key_fn()
67 int map_fd; in test_lpm_trie_map_get_next_key() local
75 map_fd = bpf_map_create(BPF_MAP_TYPE_LPM_TRIE, "lpm_trie_map", in test_lpm_trie_map_get_next_key()
78 CHECK(map_fd == -1, "bpf_map_create()", "error:%s\n", in test_lpm_trie_map_get_next_key()
83 err = bpf_map_update_elem(map_fd, &key, &val, BPF_ANY); in test_lpm_trie_map_get_next_key()
90 ctx.map_fd = map_fd; in test_lpm_trie_map_get_next_key()
108 close(map_fd); in test_lpm_trie_map_get_next_key()
A Dhtab_map_batch_ops.c14 static void map_batch_update(int map_fd, __u32 max_entries, int *keys, in map_batch_update() argument
81 int map_fd, *keys, *visited, key; in __test_map_lookup_and_delete_batch() local
94 CHECK(map_fd == -1, 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()
136 err = bpf_map_get_next_key(map_fd, NULL, &key); in __test_map_lookup_and_delete_batch()
152 err = bpf_map_lookup_batch(map_fd, in __test_map_lookup_and_delete_batch()
188 err = bpf_map_delete_batch(map_fd, in __test_map_lookup_and_delete_batch()
201 err = bpf_map_get_next_key(map_fd, NULL, &key); in __test_map_lookup_and_delete_batch()
215 err = bpf_map_lookup_and_delete_batch(map_fd, in __test_map_lookup_and_delete_batch()
246 err = bpf_map_get_next_key(map_fd, NULL, &key); in __test_map_lookup_and_delete_batch()
[all …]
A Dlpm_trie_map_batch_ops.c22 static void map_batch_update(int map_fd, __u32 max_entries, in map_batch_update() argument
40 err = bpf_map_update_batch(map_fd, keys, values, &max_entries, &opts); in map_batch_update()
70 int map_fd, *values, *visited; in test_lpm_trie_map_batch_ops() local
80 map_fd = bpf_map_create(BPF_MAP_TYPE_LPM_TRIE, "lpm_trie_map", in test_lpm_trie_map_batch_ops()
83 CHECK(map_fd == -1, "bpf_map_create()", "error:%s\n", in test_lpm_trie_map_batch_ops()
94 map_batch_update(map_fd, max_entries, keys, values); in test_lpm_trie_map_batch_ops()
105 err = bpf_map_lookup_batch(map_fd, in test_lpm_trie_map_batch_ops()
127 err = bpf_map_delete_batch(map_fd, keys + total, &count, in test_lpm_trie_map_batch_ops()
139 err = bpf_map_get_next_key(map_fd, NULL, &key); in test_lpm_trie_map_batch_ops()
154 close(map_fd); in test_lpm_trie_map_batch_ops()
A Dlpm_trie_map_basic_ops.c446 int map_fd; in test_lpm_delete() local
455 assert(map_fd >= 0); in test_lpm_delete()
547 close(map_fd); in test_lpm_delete()
556 int map_fd; in test_lpm_get_next_key() local
563 assert(map_fd >= 0); in test_lpm_get_next_key()
696 close(map_fd); in test_lpm_get_next_key()
703 int map_fd; member
751 info->map_fd = map_fd; in setup_lpm_mt_test_info()
768 int i, map_fd; in test_lpm_multi_thread() local
777 setup_lpm_mt_test_info(&info[0], map_fd); in test_lpm_multi_thread()
[all …]
A Darray_map_batch_ops.c15 static void map_batch_update(int map_fd, __u32 max_entries, int *keys, in map_batch_update() argument
36 err = bpf_map_update_batch(map_fd, keys, values, &max_entries, &opts); in map_batch_update()
72 int map_fd, *keys, *visited; in __test_map_lookup_and_update_batch() local
83 map_fd = bpf_map_create(is_pcpu ? BPF_MAP_TYPE_PERCPU_ARRAY : BPF_MAP_TYPE_ARRAY, in __test_map_lookup_and_update_batch()
85 CHECK(map_fd == -1, in __test_map_lookup_and_update_batch()
101 map_batch_update(map_fd, max_entries, keys, values, is_pcpu); in __test_map_lookup_and_update_batch()
112 err = bpf_map_lookup_batch(map_fd, in __test_map_lookup_and_update_batch()
141 close(map_fd); in __test_map_lookup_and_update_batch()
/tools/bpf/bpftool/
A Diter.c22 int err = -1, map_fd = -1; in do_pin() local
40 map_fd = map_parse_fd(&argc, &argv, BPF_F_RDONLY); in do_pin()
41 if (map_fd < 0) in do_pin()
45 linfo.map.map_fd = map_fd; in do_pin()
95 if (map_fd >= 0) in do_pin()
96 close(map_fd); in do_pin()
/tools/lib/bpf/
A Dringbuf.c33 int map_fd; member
51 int map_fd; member
93 map_fd, errstr(err)); in ring_buffer__add()
99 map_fd); in ring_buffer__add()
118 r->map_fd = map_fd; in ring_buffer__add()
128 map_fd, errstr(err)); in ring_buffer__add()
147 map_fd, errstr(err)); in ring_buffer__add()
161 map_fd, errstr(err)); in ring_buffer__add()
404 return r->map_fd; in ring__map_fd()
463 map_fd, errstr(err)); in user_ringbuf_map()
[all …]

Completed in 39 milliseconds

1234