Searched refs:map_fd (Results 1 - 25 of 110) sorted by last modified time

12345

/linux-master/net/core/
H A Dsock_map.c1673 if (!linfo->map.map_fd)
1676 map = bpf_map_get_with_uref(linfo->map.map_fd);
/linux-master/kernel/bpf/
H A Dsyscall.c1527 int ufd = attr->map_fd;
1602 int ufd = attr->map_fd;
1659 int ufd = attr->map_fd;
1716 int ufd = attr->map_fd;
2001 int ufd = attr->map_fd;
2088 #define BPF_MAP_FREEZE_LAST_FIELD map_fd
2092 int err = 0, ufd = attr->map_fd;
5153 ufd = attr->batch.map_fd;
5559 map = bpf_map_get(attr->prog_bind_map.map_fd);
H A Dmap_iter.c109 if (!linfo->map.map_fd)
112 map = bpf_map_get_with_uref(linfo->map.map_fd);
H A Dbpf_struct_ops.c1155 map = bpf_map_get(attr->link_create.map_fd);
/linux-master/tools/lib/bpf/
H A Dlibbpf.c4942 static bool map_is_reuse_compat(const struct bpf_map *map, int map_fd) argument
4950 err = bpf_map_get_info_by_fd(map_fd, &map_info, &map_info_len);
4952 err = bpf_get_map_info_from_fdinfo(map_fd, &map_info);
4954 pr_warn("failed to get map info for map FD %d: %s\n", map_fd,
5056 int err = 0, map_fd; local
5137 map_fd = map->fd;
5139 map_fd = bpf_map_create(def->type, map_name,
5143 if (map_fd < 0 && (create_attr.btf_key_type_id || create_attr.btf_value_type_id)) {
5155 map_fd = bpf_map_create(def->type, map_name,
5167 if (map_fd <
12682 int map_fd; member in struct:bpf_link_struct_ops
12868 int map_fd; /* BPF_MAP_TYPE_PERF_EVENT_ARRAY BPF map FD */ member in struct:perf_buffer
12964 perf_buffer__new(int map_fd, size_t page_cnt, perf_buffer_sample_fn sample_cb, perf_buffer_lost_fn lost_cb, void *ctx, const struct perf_buffer_opts *opts) argument
12998 perf_buffer__new_raw(int map_fd, size_t page_cnt, struct perf_event_attr *attr, perf_buffer_event_fn event_cb, void *ctx, const struct perf_buffer_raw_opts *opts) argument
13021 __perf_buffer__new(int map_fd, size_t page_cnt, struct perf_buffer_params *p) argument
13658 int prot, map_fd = map->fd; local
[all...]
H A Dlibbpf.h1278 ring_buffer__new(int map_fd, ring_buffer_sample_fn sample_cb, void *ctx,
1281 LIBBPF_API int ring_buffer__add(struct ring_buffer *rb, int map_fd,
1369 * @param map_fd A file descriptor to a BPF_MAP_TYPE_USER_RINGBUF map.
1375 user_ring_buffer__new(int map_fd, const struct user_ring_buffer_opts *opts);
1489 * @param map_fd FD of BPF_PERF_EVENT_ARRAY BPF map that will be used by BPF
1499 perf_buffer__new(int map_fd, size_t page_cnt,
1533 perf_buffer__new_raw(int map_fd, size_t page_cnt, struct perf_event_attr *attr,
H A Dbpf.h203 * hold *count* items based on the key and value size of the map *map_fd*. The *keys*
527 * map corresponding to *map_fd*.
535 * @param map_fd BPF map file descriptor
543 LIBBPF_API int bpf_map_get_info_by_fd(int map_fd, struct bpf_map_info *info, __u32 *info_len);
641 LIBBPF_API int bpf_prog_bind_map(int prog_fd, int map_fd,
H A Dbpf.c395 attr.map_fd = fd;
411 attr.map_fd = fd;
426 attr.map_fd = fd;
442 attr.map_fd = fd;
457 attr.map_fd = fd;
473 attr.map_fd = fd;
487 attr.map_fd = fd;
502 attr.map_fd = fd;
512 const size_t attr_sz = offsetofend(union bpf_attr, map_fd);
517 attr.map_fd
1161 bpf_map_get_info_by_fd(int map_fd, struct bpf_map_info *info, __u32 *info_len) argument
1283 bpf_prog_bind_map(int prog_fd, int map_fd, const struct bpf_prog_bind_opts *opts) argument
[all...]
/linux-master/tools/perf/util/
H A Dbpf_lock_contention.c196 static void update_lock_stat(int map_fd, int pid, u64 end_ts, argument
226 if (bpf_map_lookup_elem(map_fd, &stat_key, &stat_data) < 0)
237 bpf_map_update_elem(map_fd, &stat_key, &stat_data, BPF_EXIST);
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/perf/
H A Dbuiltin-trace.c3561 int map_fd = bpf_map__fd(map); local
3565 err = bpf_map_update_elem(map_fd, &pids[i], &value, BPF_ANY);
/linux-master/tools/testing/selftests/bpf/
H A Dtest_maps.c929 /* Test map update elem afterwards fd lives in fd and map_fd */
1408 int map_update_retriable(int map_fd, const void *key, const void *value, int flags, int attempts, argument
1413 while (bpf_map_update_elem(map_fd, key, value, flags)) {
1427 static int map_delete_retriable(int map_fd, const void *key, int attempts) argument
1431 while (bpf_map_delete_elem(map_fd, key)) {
1633 static void prepare_reuseport_grp(int type, int map_fd, size_t map_elem_size, argument
1673 err = bpf_map_update_elem(map_fd, &index0, value, BPF_ANY);
1701 err = bpf_map_update_elem(map_fd, &index0, value,
1727 int map_fd, err, t, f; local
1731 map_fd
[all...]
H A Dtest_lpm_map.c428 int map_fd; local
434 map_fd = bpf_map_create(BPF_MAP_TYPE_LPM_TRIE, NULL,
437 assert(map_fd >= 0);
454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0);
459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0);
464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0);
469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0);
474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT);
478 assert(bpf_map_delete_elem(map_fd, key) == -ENOENT);
482 assert(bpf_map_delete_elem(map_fd, ke
538 int map_fd; local
685 int map_fd; member in struct:lpm_mt_test_info
730 setup_lpm_mt_test_info(struct lpm_mt_test_info *info, int map_fd) argument
750 int i, map_fd; local
[all...]
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/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 Dmptcp.c85 static int verify_tsk(int map_fd, int client_fd) argument
90 err = bpf_map_lookup_elem(map_fd, &cfd, &val);
123 static int verify_msk(int map_fd, int client_fd, __u32 token) argument
134 err = bpf_map_lookup_elem(map_fd, &cfd, &val);
158 int client_fd, prog_fd, map_fd, err; local
170 map_fd = bpf_map__fd(sock_skel->maps.socket_storage_map);
181 err += is_mptcp ? verify_msk(map_fd, client_fd, sock_skel->bss->token) :
182 verify_tsk(map_fd, client_fd);
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);
/linux-master/tools/include/uapi/linux/
H A Dbpf.h123 __u32 map_fd; member in struct:bpf_iter_link_info::__anon3122
172 * by the file descriptor *map_fd*.
610 * map state of *map_fd*. Write operations from eBPF programs
650 * and value size of the map *map_fd*. The *keys* buffer must be
701 * and value size of the map *map_fd*. The *keys* buffer must be
752 * size of the map *map_fd*, that is, *key_size* * *count*.
865 * The map identified by *map_fd* is bound to the program
1498 __u32 map_fd; member in struct:bpf_attr::__anon3131
1519 __u32 map_fd; member in struct:bpf_attr::__anon3133
1706 __u32 map_fd; /* struct_op member in union:bpf_attr::__anon3150::__anon3151
1811 __u32 map_fd; member in struct:bpf_attr::__anon3170
[all...]
/linux-master/tools/bpf/bpftool/
H A Dprog.c228 int map_fd; local
256 map_fd = bpf_map_get_fd_by_id(map_ids[i]);
257 if (map_fd < 0)
262 ret = bpf_map_get_info_by_fd(map_fd, map_info, &map_info_len);
264 close(map_fd);
273 close(map_fd);
279 close(map_fd);
283 if (bpf_map_lookup_elem(map_fd, &key, value)) {
284 close(map_fd);
290 close(map_fd);
2267 profile_open_perf_event(int mid, int cpu, int map_fd) argument
2298 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...]
/linux-master/include/uapi/linux/
H A Dbpf.h123 __u32 map_fd; member in struct:bpf_iter_link_info::__anon2581
172 * by the file descriptor *map_fd*.
610 * map state of *map_fd*. Write operations from eBPF programs
650 * and value size of the map *map_fd*. The *keys* buffer must be
701 * and value size of the map *map_fd*. The *keys* buffer must be
752 * size of the map *map_fd*, that is, *key_size* * *count*.
865 * The map identified by *map_fd* is bound to the program
1498 __u32 map_fd; member in struct:bpf_attr::__anon2590
1519 __u32 map_fd; member in struct:bpf_attr::__anon2592
1706 __u32 map_fd; /* struct_op member in union:bpf_attr::__anon2609::__anon2610
1811 __u32 map_fd; member in struct:bpf_attr::__anon2629
[all...]
/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...]

Completed in 427 milliseconds

12345