/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 174 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0() 175 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0() 179 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0() 182 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0() 191 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0() 194 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0() 210 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0() 211 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0() 272 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1() 279 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1() [all …]
|
H A D | test_maps.c | 47 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 51 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap() 65 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 74 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) < 0 && in test_hashmap() 79 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap() 85 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 90 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == 0); in test_hashmap() 92 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 94 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() [all …]
|
H A D | test_lpm_map.c |
|
H A D | test_sockmap.c | 1138 err = bpf_map_update_elem(map_fd[1], &i, &c1, BPF_ANY); in run_options() 1141 "ERROR: bpf_map_update_elem (txmsg): %d (%s\n", in run_options() 1151 err = bpf_map_update_elem(map_fd[2], &i, &redir_fd, BPF_ANY); in run_options() 1154 "ERROR: bpf_map_update_elem (txmsg): %d (%s\n", in run_options() 1160 err = bpf_map_update_elem(map_fd[3], in run_options() 1164 "ERROR: bpf_map_update_elem (apply_bytes): %d (%s\n", in run_options() 1171 err = bpf_map_update_elem(map_fd[4], in run_options() 1175 "ERROR: bpf_map_update_elem (cork_bytes): %d (%s\n", in run_options() 1182 err = bpf_map_update_elem(map_fd[5], in run_options() 1186 "ERROR: bpf_map_update_elem (txmsg_star in run_options() [all...] |
/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | btf_map_in_map.c | 48 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 …]
|
H A D | bloom_filter_map.c | 46 err = bpf_map_update_elem(fd, NULL, &value, -1); in test_fail_cases() 49 err = bpf_map_update_elem(fd, NULL, &value, BPF_EXIST); in test_fail_cases() 52 err = bpf_map_update_elem(fd, NULL, &value, BPF_F_LOCK); in test_fail_cases() 55 err = bpf_map_update_elem(fd, NULL, &value, BPF_NOEXIST); in test_fail_cases() 58 err = bpf_map_update_elem(fd, NULL, &value, 10000); in test_fail_cases() 77 err = bpf_map_update_elem(fd, NULL, &value, 0); in test_success_cases() 117 err = bpf_map_update_elem(inner_map_fd, NULL, rand_vals + i, BPF_ANY); in test_inner_map() 124 err = bpf_map_update_elem(outer_map_fd, &key, &inner_map_fd, BPF_ANY); in test_inner_map() 176 err = bpf_map_update_elem(random_data_fd, &i, &val, BPF_ANY); in setup_progs() 180 err = bpf_map_update_elem(bloom_fd, NULL, &val, BPF_ANY); in setup_progs()
|
H A D | sockmap_basic.c | 103 err = bpf_map_update_elem(map, &zero, &s, BPF_NOEXIST); in test_sockmap_create_update_free() 128 err = bpf_map_update_elem(map, &zero, &c, BPF_NOEXIST); in test_sockmap_vsock_delete_on_close() 133 err = bpf_map_update_elem(map, &zero, &p, BPF_NOEXIST); in test_sockmap_vsock_delete_on_close() 252 err = bpf_map_update_elem(src, &zero, &sk, BPF_NOEXIST); in test_sockmap_update() 319 err = bpf_map_update_elem(src_fd, &i, &sock_fd[i], BPF_NOEXIST); in test_sockmap_copy() 506 err = bpf_map_update_elem(map, &zero, &c1, BPF_NOEXIST); in test_sockmap_skb_verdict_shutdown() 562 err = bpf_map_update_elem(map, &zero, &p, BPF_NOEXIST); in test_sockmap_stream_pass() 620 err = bpf_map_update_elem(map, &zero, &c1, BPF_NOEXIST); in test_sockmap_skb_verdict_fionread() 667 err = bpf_map_update_elem(map, &zero, &c1, BPF_NOEXIST); in test_sockmap_skb_verdict_change_tail() 705 err = bpf_map_update_elem(map, &zero, &c1, BPF_NOEXIST); in test_sockmap_skb_verdict_peek_helper() [all …]
|
H A D | xdp_cpumap_attach.c | 47 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_helpers() 81 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers() 90 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_cpumap_frags_helpers() 121 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in serial_test_xdp_cpumap_attach() 135 err = bpf_map_update_elem(map_fd, &idx, &val, 0);
|
H A D | tailcalls.c | 62 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 92 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 113 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1() 198 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_2() 273 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_count() 467 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_4() 473 err = bpf_map_update_elem(data_fd, &zero, &i, BPF_ANY); in test_tailcall_4() 483 err = bpf_map_update_elem(data_fd, &zero, &i, BPF_ANY); in test_tailcall_4() 557 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_5() 563 err = bpf_map_update_elem(data_fd, &zero, &key[i], BPF_ANY); in test_tailcall_5() [all …]
|
H A D | verify_pkcs7_sig.c | 318 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 327 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 336 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 347 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 361 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 369 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, BPF_ANY); in test_verify_pkcs7_sig_from_map() 382 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig_from_map() 389 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig_from_map() 396 ret = bpf_map_update_elem(bpf_map__fd(map), &zero, &data, in test_verify_pkcs7_sig_from_map()
|
H A D | xdp_devmap_attach.c | 51 err = bpf_map_update_elem(map_fd, &idx, &val, 0); 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() 132 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_frags_helpers() 146 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_frags_helpers() 195 err = bpf_map_update_elem(map_fd, &idx, &val, 0); in test_xdp_with_devmap_helpers_veth()
|
H A D | map_lookup_percpu_elem.c | 37 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()
|
H A D | xdp_noinline.c | 44 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()
|
H A D | l4lb_all.c | 44 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/tools/testing/selftests/bpf/progs/ |
H A D | timer.c | 115 bpf_map_update_elem(map, &lru_key, &init, 0); in timer_cb1() 147 bpf_map_update_elem(&lru, &lru_key, &init, 0); in BPF_PROG2() 257 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2() 262 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2() 264 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2() 269 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2() 275 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2() 280 bpf_map_update_elem(&hmap, &key, &init, 0); in BPF_PROG2() 287 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2() 292 bpf_map_update_elem(&hmap_malloc, &key_malloc, &init, 0); in BPF_PROG2() [all …]
|
H A D | test_mmap.c | 36 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()
|
H A D | linked_maps2.c | 46 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()
|
H A D | linked_maps1.c | 52 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()
|
H A D | test_map_ops.c | 46 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()
|
/linux/samples/bpf/ |
H A D | map_perf_test.bpf.c | 112 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()
|
H A D | test_map_in_map_user.c | 53 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()
|
H A D | test_lru_dist.c | 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() 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()
|
H A D | ibumad_kern.c | 87 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/Documentation/bpf/ |
H A D | map_array.rst | 47 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
|
/linux/tools/testing/selftests/bpf/map_tests/ |
H A D | sk_storage_map.c | 189 err = bpf_map_update_elem(map_fd, &sk_fds[i], &value, in insert_close_thread() 288 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); in update_thread() 480 err = bpf_map_update_elem(map_fd, &sk_fd, &value, in test_sk_storage_map_basic() 494 err = bpf_map_update_elem(map_fd, &sk_fd, &value, in test_sk_storage_map_basic() 508 err = bpf_map_update_elem(map_fd, &sk_fd, &value, BPF_EXIST); in test_sk_storage_map_basic() 521 err = bpf_map_update_elem(map_fd, &sk_fd, &value, in test_sk_storage_map_basic() 526 err = bpf_map_update_elem(map_fd, &sk_fd, &value, BPF_NOEXIST); in test_sk_storage_map_basic() 540 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0); in test_sk_storage_map_basic()
|