Searched refs:map_fd (Results 26 - 50 of 110) sorted by last modified time

12345

/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dtoken.c501 int err, token_fd = -1, map_fd = -1; local
522 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "wo_token_wo_bpf", 0, 8, 1, &map_opts);
523 if (!ASSERT_LT(map_fd, 0, "stack_map_wo_token_wo_cap_bpf_should_fail")) {
531 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "w_token_wo_bpf", 0, 8, 1, &map_opts);
532 if (!ASSERT_LT(map_fd, 0, "stack_map_w_token_wo_cap_bpf_should_fail")) {
545 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "wo_token_w_bpf", 0, 8, 1, &map_opts);
546 if (!ASSERT_LT(map_fd, 0, "stack_map_wo_token_w_cap_bpf_should_fail")) {
554 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "w_token_w_bpf", 0, 8, 1, &map_opts);
555 if (!ASSERT_GT(map_fd, 0, "stack_map_w_token_w_cap_bpf")) {
562 zclose(map_fd);
[all...]
H A Dtask_local_storage.c82 int err, map_fd, prog_fd, task_fd; local
109 map_fd = bpf_map__fd(skel->maps.map_a);
110 err = bpf_map_lookup_elem(map_fd, &task_fd, &value);
115 map_fd = bpf_map__fd(skel->maps.map_b);
116 err = bpf_map_lookup_elem(map_fd, &task_fd, &value);
H A Dbtf.c4352 int map_fd = -1, btf_fd = -1; local
4398 map_fd = bpf_map_create(test->map_type, test->map_name,
4401 err = ((map_fd < 0) != test->map_create_err);
4402 CHECK(err, "map_fd:%d test->map_create_err:%u",
4403 map_fd, test->map_create_err);
4410 if (map_fd >= 0)
4411 close(map_fd);
4563 int btf_fd[2] = {-1, -1}, map_fd = -1; local
4627 map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, "test_btf_id",
4629 if (CHECK(map_fd <
5418 int map_fd = -1, btf_fd = -1; local
[all...]
H A Dxdp_bonding.c348 int map_fd = bpf_map__fd(skeletons->xdp_redirect_multi_kern->maps.map_all); local
353 err = bpf_map_update_elem(map_fd, &ifindex, &ifindex, 0);
H A Dsyscall.c10 int map_fd; member in struct:args
39 ASSERT_GT(ctx.map_fd, 0, "ctx.map_fd");
44 err = bpf_map_lookup_elem(ctx.map_fd, &key, &value);
51 if (ctx.map_fd > 0)
52 close(ctx.map_fd);
H A Dbpf_iter.c88 linfo.map.map_fd = bpf_map__fd(map);
762 int err, i, len, map_fd, iter_fd; local
785 linfo.map.map_fd = bpf_map__fd(skel->maps.hashmap2);
792 linfo.map.map_fd = bpf_map__fd(skel->maps.hashmap3);
798 map_fd = bpf_map__fd(skel->maps.hashmap1);
808 err = bpf_map_update_elem(map_fd, &key, &val, BPF_ANY);
814 linfo.map.map_fd = map_fd;
819 linfo.map.map_fd = map_fd;
855 int err, i, j, len, map_fd, iter_fd; local
939 int err, i, map_fd, hash_fd, iter_fd; local
1039 int err, i, j, map_fd, iter_fd; local
1112 int err, len, map_fd, iter_fd; local
1181 int err, map_fd, val = -1; local
1238 int err, i, len, map_fd, iter_fd, num_sockets; local
[all...]
H A Dbpf_obj_id.c210 int map_fd, cmp_res; local
214 map_fd = bpf_map_get_fd_by_id(next_id);
215 if (map_fd < 0 && errno == ENOENT)
218 if (!ASSERT_GE(map_fd, 0, "bpf_map_get_fd_by_id"))
230 err = bpf_map_lookup_elem(map_fd, &array_key, &array_value);
234 err = bpf_map_get_info_by_fd(map_fd, &map_info, &info_len);
241 close(map_fd);
H A Dtailcalls.c14 int err, map_fd, prog_fd, main_fd, i, j; local
43 map_fd = bpf_map__fd(prog_array);
44 if (CHECK_FAIL(map_fd < 0))
58 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY);
68 err = bpf_map_delete_elem(map_fd, &i);
88 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY);
109 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY);
121 err = bpf_map_delete_elem(map_fd, &i);
131 err = bpf_map_delete_elem(map_fd, &i);
150 int err, map_fd, prog_f local
229 int err, map_fd, prog_fd, main_fd, data_fd, i, val; local
410 int err, map_fd, prog_fd, main_fd, data_fd, i; local
500 int err, map_fd, prog_fd, main_fd, data_fd, i, key[] = { 1111, 1234, 5678 }; local
590 int err, map_fd, prog_fd, main_fd, i; local
674 int err, map_fd, prog_fd, main_fd, data_fd, i, val; local
754 int err, map_fd, prog_fd, main_fd, i; local
848 int err, map_fd, prog_fd, main_fd, data_fd, i; local
933 int err, map_fd, prog_fd, main_fd, data_fd, i, val; local
1012 int err, map_fd, prog_fd, data_fd, i, val; local
1117 __u32 zero = 0, prog1_fd, prog2_fd, map_fd; local
[all...]
H A Dsk_storage_omem_uncharge.c12 int sk_fd = -1, map_fd, err, value; local
18 map_fd = bpf_map__fd(skel->maps.sk_storage);
33 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0);
38 err = bpf_map_update_elem(map_fd, &sk_fd, &value, 0);
H A Dbpf_obj_pinning.c41 int map_fd = -1, map_fd2 = -1; local
75 map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, map_name, 4, 4, 1, NULL);
76 if (!ASSERT_GE(map_fd, 0, "map_fd"))
82 err = bpf_obj_pin_opts(map_fd, map_name, &pin_opts);
95 err = bpf_map_update_elem(map_fd, &zero, &src_value, 0);
106 if (map_fd >= 0)
107 ASSERT_OK(close(map_fd), "close_map_fd");
123 static void validate_pin(int map_fd, const char *map_name, int src_value, argument
155 err = bpf_obj_pin_opts(map_fd, pin_pat
183 validate_get(int map_fd, const char *map_name, int src_value, enum path_kind path_kind) argument
247 int map_fd; local
[all...]
/linux-master/samples/bpf/
H A Dmap_perf_test_user.c69 static int map_fd[NR_IDXES]; variable
96 int fd = map_fd[lru_hash_lookup_idx];
134 int outer_fd = map_fd[array_of_lru_hashs_idx];
387 r = bpf_map_update_elem(map_fd[hash_map_alloc_idx],
399 r = bpf_map_update_elem(map_fd[hash_map_alloc_idx], key, &value, 0);
475 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "array_of_lru_hashs");
476 map_fd[1] = bpf_object__find_map_fd_by_name(obj, "hash_map_alloc");
477 map_fd[2] = bpf_object__find_map_fd_by_name(obj, "lru_hash_lookup_map");
478 if (map_fd[0] < 0 || map_fd[
[all...]
H A Dtracex6_user.c23 static int map_fd[3]; variable
43 assert(bpf_map_update_elem(map_fd[0], &cpu, &pmu_fd, BPF_ANY) == 0);
46 bpf_map_get_next_key(map_fd[1], &cpu, NULL);
48 if (bpf_map_lookup_elem(map_fd[1], &cpu, &value)) {
56 if (bpf_map_lookup_elem(map_fd[2], &cpu, &value2)) {
66 assert(bpf_map_delete_elem(map_fd[0], &cpu) == 0 || error);
69 assert(bpf_map_delete_elem(map_fd[1], &cpu) == 0 || error);
196 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "counters");
197 map_fd[1] = bpf_object__find_map_fd_by_name(obj, "values");
198 map_fd[
[all...]
H A Dtracex3_user.c113 int map_fd, i, j = 0; local
141 map_fd = bpf_object__find_map_fd_by_name(obj, "lat_map");
142 if (map_fd < 0) {
173 print_hist(map_fd);
H A Dtracex4_user.c54 int map_fd, j = 0; local
69 map_fd = bpf_object__find_map_fd_by_name(obj, "my_map");
70 if (map_fd < 0) {
86 print_old_objects(map_fd);
H A Dspintest_user.c16 int map_fd, i, j = 0; local
39 map_fd = bpf_object__find_map_fd_by_name(obj, "my_map");
40 if (map_fd < 0) {
58 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) {
59 bpf_map_lookup_elem(map_fd, &next_key, &value);
73 while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0)
74 bpf_map_delete_elem(map_fd, &next_key);
H A Doffwaketime_user.c18 static int map_fd[2]; variable
54 if (bpf_map_lookup_elem(map_fd[1], &key->tret, ip) != 0) {
61 if (bpf_map_lookup_elem(map_fd[1], &key->wret, ip) != 0) {
91 print_stacks(map_fd[0]);
122 map_fd[0] = bpf_object__find_map_fd_by_name(obj, "counts");
123 map_fd[1] = bpf_object__find_map_fd_by_name(obj, "stackmap");
124 if (map_fd[0] < 0 || map_fd[1] < 0) {
145 print_stacks(map_fd[0]);
/linux-master/kernel/bpf/
H A Dmap_iter.c109 if (!linfo->map.map_fd)
112 map = bpf_map_get_with_uref(linfo->map.map_fd);
/linux-master/drivers/hid/bpf/
H A Dhid_bpf_jmp_table.c190 static void __hid_bpf_do_release_prog(int map_fd, unsigned int idx) argument
192 skel_map_delete_elem(map_fd, &idx);
198 int i, j, n, map_fd = -1; local
205 map_fd = skel_map_get_fd_by_id(jmp_table.map->id);
206 if (map_fd < 0)
267 __hid_bpf_do_release_prog(map_fd, entry->idx);
286 if (map_fd >= 0)
287 close_fd(map_fd);
292 int map_fd = -1; local
295 map_fd
310 int i, index = -1, map_fd = -1, err = -EINVAL; local
[all...]
/linux-master/tools/perf/util/
H A Dbpf_counter.c321 int map_fd, err; local
331 map_fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL,
335 if (map_fd < 0)
338 err = bpf_obj_pin(map_fd, path);
341 close(map_fd);
342 map_fd = bpf_obj_get(path);
343 if (map_fd < 0)
347 map_fd = bpf_obj_get(path);
348 if (map_fd < 0)
352 if (!bperf_attr_map_compatible(map_fd)) {
[all...]
/linux-master/tools/testing/selftests/bpf/
H A Dxsk.c442 int map_fd; local
444 map_fd = bpf_map__fd(map);
445 bpf_map_delete_elem(map_fd, &index);
450 int map_fd, sock_fd; local
452 map_fd = bpf_map__fd(map);
455 return bpf_map_update_elem(map_fd, &index, &sock_fd, 0);
H A Dtest_maps.h21 int map_update_retriable(int map_fd, const void *key, const void *value, int flags, int attempts,
/linux-master/tools/testing/selftests/bpf/progs/
H A Dsyscall.c22 int map_fd; member in struct:args
117 static union bpf_attr map_update_attr = { .map_fd = 1, };
143 ctx->map_fd = ret;
146 map_update_attr.map_fd = ret;
187 attr->map_fd = outer_fd;
195 attr->map_fd = outer_fd;
/linux-master/tools/testing/selftests/bpf/map_tests/
H A Dmap_percpu_stats.c21 static void map_info(int map_fd, struct bpf_map_info *info) argument
28 ret = bpf_obj_get_info_by_fd(map_fd, info, &len);
50 static __u32 map_count_elements(__u32 type, int map_fd) argument
55 while (!bpf_map_get_next_key(map_fd, &key, &key))
62 static void delete_and_lookup_batch(int map_fd, void *keys, __u32 count) argument
69 ret = bpf_map_lookup_and_delete_batch(map_fd,
88 static void delete_all_elements(__u32 type, int map_fd, bool batch) argument
99 for (n = 0; !bpf_map_get_next_key(map_fd, &key, &key); n++)
107 delete_and_lookup_batch(map_fd, keys, n);
114 ret = bpf_map_delete_elem(map_fd, key
142 int map_fd; member in struct:upsert_opts
149 int map_fd; local
263 check_expected_number_elements(__u32 n_inserted, int map_fd, struct bpf_map_info *info) argument
291 __test(int map_fd) argument
341 int map_fd; local
[all...]
H A Dmap_in_map_batch_ops.c15 static __u32 get_map_id_from_fd(int map_fd) argument
21 ret = bpf_map_get_info_by_fd(map_fd, &map_info, &info_len);
34 int map_fd, map_index, ret; local
41 map_fd = bpf_map_create(map_type, map_name, sizeof(__u32),
43 CHECK(map_fd < 0,
51 inner_map_fds[map_index] = map_fd;
57 map_id = get_map_id_from_fd(map_fd);
58 ret = bpf_map_update_elem(map_fd, &map_key, &map_id, 0);
/linux-master/tools/testing/selftests/bpf/benchs/
H A Dbench_ringbufs.c208 int map_fd; member in struct:ringbuf_custom
244 r->map_fd = bpf_map__fd(ctx->skel->maps.ringbuf);
249 r->map_fd, 0);
258 r->map_fd, page_size);
267 err = epoll_ctl(ctx->epoll_fd, EPOLL_CTL_ADD, r->map_fd, &ctx->event);
472 int map_fd; /* BPF_MAP_TYPE_PERF_EVENT_ARRAY BPF map FD */ member in struct:perf_buffer

Completed in 186 milliseconds

12345