Home
last modified time | relevance | path

Searched refs:bpf_map_update_elem (Results 1 – 25 of 213) sorted by relevance

123456789

/linux-6.6.21/tools/testing/selftests/bpf/
Dtest_lru_map.c173 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
178 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
181 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
190 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
193 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
209 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
210 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
271 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
278 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
[all …]
Dtest_maps.c51 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
55 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap()
60 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap()
69 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
78 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) < 0 && in test_hashmap()
83 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap()
89 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap()
94 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == 0); in test_hashmap()
96 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
98 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap()
[all …]
Dtest_lpm_map.c253 r = bpf_map_update_elem(map, key, value, 0); in test_lpm_map()
361 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
366 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
371 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
376 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
381 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
386 assert(bpf_map_update_elem(map_fd_ipv6, key_ipv6, &value, 0) == 0); in test_lpm_ipaddr()
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()
[all …]
Dtest_sockmap.c1044 err = bpf_map_update_elem(map_fd[1], &i, &c1, BPF_ANY); in run_options()
1057 err = bpf_map_update_elem(map_fd[2], &i, &redir_fd, BPF_ANY); in run_options()
1066 err = bpf_map_update_elem(map_fd[3], in run_options()
1077 err = bpf_map_update_elem(map_fd[4], in run_options()
1088 err = bpf_map_update_elem(map_fd[5], in run_options()
1100 err = bpf_map_update_elem(map_fd[5], in run_options()
1112 err = bpf_map_update_elem(map_fd[5], in run_options()
1124 err = bpf_map_update_elem(map_fd[5], in run_options()
1136 err = bpf_map_update_elem(map_fd[5], in run_options()
1146 bpf_map_update_elem(map_fd[5], in run_options()
[all …]
/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/
Dbtf_map_in_map.c48 bpf_map_update_elem(outer_arr_fd, &key, &map1_fd, 0); in test_lookup_update()
49 bpf_map_update_elem(outer_hash_fd, &key, &map2_fd, 0); in test_lookup_update()
50 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map3_fd, 0); in test_lookup_update()
61 bpf_map_update_elem(outer_arr_fd, &key, &map2_fd, 0); in test_lookup_update()
62 bpf_map_update_elem(outer_hash_fd, &key, &map1_fd, 0); in test_lookup_update()
63 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map4_fd, 0); in test_lookup_update()
74 bpf_map_update_elem(outer_arr_dyn_fd, &key, &map5_fd, 0); in test_lookup_update()
82 err = bpf_map_update_elem(outer_hash_fd, &key, &val, 0); in test_lookup_update()
87 err = bpf_map_update_elem(outer_arr_fd, &key, &val, 0); in test_lookup_update()
93 err = bpf_map_update_elem(outer_arr_dyn_fd, &key, &val, 0); in test_lookup_update()
[all …]
Dbloom_filter_map.c40 err = bpf_map_update_elem(fd, NULL, &value, -1); in test_fail_cases()
43 err = bpf_map_update_elem(fd, NULL, &value, BPF_EXIST); in test_fail_cases()
46 err = bpf_map_update_elem(fd, NULL, &value, BPF_F_LOCK); in test_fail_cases()
49 err = bpf_map_update_elem(fd, NULL, &value, BPF_NOEXIST); in test_fail_cases()
52 err = bpf_map_update_elem(fd, NULL, &value, 10000); in test_fail_cases()
71 err = bpf_map_update_elem(fd, NULL, &value, 0); in test_success_cases()
111 err = bpf_map_update_elem(inner_map_fd, NULL, rand_vals + i, BPF_ANY); in test_inner_map()
118 err = bpf_map_update_elem(outer_map_fd, &key, &inner_map_fd, BPF_ANY); in test_inner_map()
170 err = bpf_map_update_elem(random_data_fd, &i, &val, BPF_ANY); in setup_progs()
174 err = bpf_map_update_elem(bloom_fd, NULL, &val, BPF_ANY); in setup_progs()
Dverify_pkcs7_sig.c311 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
320 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
329 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
340 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
354 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
362 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig()
375 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig()
382 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig()
389 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig()
Dxdp_cpumap_attach.c41 err = bpf_map_update_elem(map_fd, &idx, &val, 0); 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()
93 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers()
107 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers()
Dxdp_devmap_attach.c43 err = bpf_map_update_elem(map_fd, &idx, &val, 0); 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()
106 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_frags_helpers()
120 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_frags_helpers()
Dtailcalls.c55 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); 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()
191 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_2()
264 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_count()
372 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_4()
378 err = bpf_map_update_elem(data_fd, &zero, &i, BPF_ANY); in test_tailcall_4()
388 err = bpf_map_update_elem(data_fd, &zero, &i, BPF_ANY); in test_tailcall_4()
462 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_5()
468 err = bpf_map_update_elem(data_fd, &zero, &key[i], BPF_ANY); in test_tailcall_5()
[all …]
Dmap_lookup_percpu_elem.c37 ret = bpf_map_update_elem(bpf_map__fd(skel->maps.percpu_array_map), &key, buf, 0); in test_map_lookup_percpu_elem()
40 ret = bpf_map_update_elem(bpf_map__fd(skel->maps.percpu_hash_map), &key, buf, 0); in test_map_lookup_percpu_elem()
43 ret = bpf_map_update_elem(bpf_map__fd(skel->maps.percpu_lru_hash_map), &key, buf, 0); in test_map_lookup_percpu_elem()
Dxdp_noinline.c44 bpf_map_update_elem(bpf_map__fd(skel->maps.vip_map), &key, &value, 0); in test_xdp_noinline()
45 bpf_map_update_elem(bpf_map__fd(skel->maps.ch_rings), &ch_key, &real_num, 0); in test_xdp_noinline()
46 bpf_map_update_elem(bpf_map__fd(skel->maps.reals), &real_num, &real_def, 0); in test_xdp_noinline()
Dl4lb_all.c44 bpf_map_update_elem(map_fd, &key, &value, 0); in test_l4lb()
49 bpf_map_update_elem(map_fd, &ch_key, &real_num, 0); in test_l4lb()
54 bpf_map_update_elem(map_fd, &real_num, &real_def, 0); in test_l4lb()
/linux-6.6.21/tools/testing/selftests/bpf/progs/
Dtimer.c111 bpf_map_update_elem(map, &lru_key, &init, 0); in timer_cb1()
143 bpf_map_update_elem(&lru, &lru_key, &init, 0); in BPF_PROG2()
253 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2()
258 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2()
260 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2()
265 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2()
271 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2()
276 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2()
283 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2()
288 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2()
Dtest_mmap.c36 bpf_map_update_elem(&data_map, &two, (const void *)&in_val, 0); in test_mmap()
42 bpf_map_update_elem(&data_map, &one, &val, 0); in test_mmap()
47 bpf_map_update_elem(&data_map, &far, &val, 0); in test_mmap()
Dlinked_maps1.c52 bpf_map_update_elem(&map1, &key_struct, &val_struct, 0); in BPF_PROG()
53 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG()
54 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG()
Dlinked_maps2.c46 bpf_map_update_elem(&map1, &key_struct, &val_struct, 0); in BPF_PROG()
47 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG()
48 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG()
Dtest_map_ops.c46 err = bpf_map_update_elem(&hash_map, &key, &val, BPF_NOEXIST); in map_update()
114 bpf_map_update_elem(&array_map, &key, &val, flags); in map_for_each_pass()
132 bpf_map_update_elem(&array_map, &key, &val, flags); in map_for_each_fail()
Dtest_btf_map_in_map.c133 bpf_map_update_elem(inner_map, &key, &val, 0); in handle__sys_enter()
139 bpf_map_update_elem(inner_map, &key, &val, 0); in handle__sys_enter()
145 bpf_map_update_elem(inner_map, &key, &val, 0); in handle__sys_enter()
Dlru_bug.c26 bpf_map_update_elem(&lru_map, &(int){0}, &v, 0); in printk()
36 bpf_map_update_elem(&lru_map, &(int){0}, &val, 0); in nanosleep()
/linux-6.6.21/samples/bpf/
Dtest_map_in_map_user.c53 ret = bpf_map_update_elem(PORT_A, &port_key, &magic_result, BPF_ANY); in populate_map()
56 ret = bpf_map_update_elem(PORT_H, &port_key, &magic_result, in populate_map()
60 ret = bpf_map_update_elem(A_OF_PORT_A, &port_key, &PORT_A, BPF_ANY); in populate_map()
64 ret = bpf_map_update_elem(H_OF_PORT_A, &port_key, &PORT_A, BPF_NOEXIST); in populate_map()
68 ret = bpf_map_update_elem(H_OF_PORT_H, &port_key, &PORT_H, BPF_NOEXIST); in populate_map()
Dmap_perf_test.bpf.c112 bpf_map_update_elem(&hash_map, &key, &init_val, BPF_ANY); in BPF_KSYSCALL()
130 bpf_map_update_elem(&percpu_hash_map, &key, &init_val, BPF_ANY); in BPF_KSYSCALL()
147 bpf_map_update_elem(&hash_map_alloc, &key, &init_val, BPF_ANY); in BPF_KSYSCALL()
164 bpf_map_update_elem(&percpu_hash_map_alloc, &key, &init_val, BPF_ANY); in BPF_KSYSCALL()
210 ret = bpf_map_update_elem(&lru_hash_map, &key, &val, BPF_ANY); in BPF_KSYSCALL()
212 ret = bpf_map_update_elem(&nocommon_lru_hash_map, &key, &val, in BPF_KSYSCALL()
225 ret = bpf_map_update_elem(nolocal_lru_map, &key, &val, in BPF_KSYSCALL()
Dtest_lru_dist.c147 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()
287 if (bpf_map_update_elem(lru_map_fd, &key, &value, BPF_NOEXIST)) { in do_test_lru_dist()
357 assert(bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST) == 0); in test_lru_loss0()
407 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_loss1()
435 assert(bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
449 bpf_map_update_elem(map_fd, &next_ins_key, value, in do_test_parallel_lru_loss()
Dibumad_kern.c87 bpf_map_update_elem(&read_count, &class, &zero, BPF_NOEXIST); in on_ib_umad_read_recv()
107 bpf_map_update_elem(&read_count, &class, &zero, BPF_NOEXIST); in on_ib_umad_read_send()
127 bpf_map_update_elem(&write_count, &class, &zero, BPF_NOEXIST); in on_ib_umad_write()
/linux-6.6.21/Documentation/bpf/
Dmap_array.rst47 bpf_map_update_elem()
52 long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
54 Array elements can be updated using the ``bpf_map_update_elem()`` helper.
56 ``bpf_map_update_elem()`` returns 0 on success, or negative error in case of
60 To clear an array element, you may use ``bpf_map_update_elem()`` to insert a
70 When using a ``BPF_MAP_TYPE_PERCPU_ARRAY`` the ``bpf_map_update_elem()`` and
179 ret = bpf_map_update_elem(fd, &i, &value, BPF_ANY);
224 ret = bpf_map_update_elem(fd, &i, &values, BPF_ANY);
261 When calling ``bpf_map_update_elem()`` the flag ``BPF_NOEXIST`` can not be used

123456789