Home
last modified time | relevance | path

Searched refs:bpf_map (Results 1 – 25 of 78) sorted by relevance

1234

/Linux-v5.4/include/linux/
Dbpf.h21 struct bpf_map;
34 struct bpf_map *(*map_alloc)(union bpf_attr *attr);
35 void (*map_release)(struct bpf_map *map, struct file *map_file);
36 void (*map_free)(struct bpf_map *map);
37 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);
38 void (*map_release_uref)(struct bpf_map *map);
39 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key);
42 void *(*map_lookup_elem)(struct bpf_map *map, void *key);
43 int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags);
44 int (*map_delete_elem)(struct bpf_map *map, void *key);
[all …]
Dbpf-cgroup.h17 struct bpf_map;
136 struct bpf_map *map) in cgroup_storage_type()
160 int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *map);
161 void bpf_cgroup_storage_release(struct bpf_prog *prog, struct bpf_map *map);
163 int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value);
164 int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
364 struct bpf_map *map) { return 0; } in bpf_cgroup_storage_assign()
366 struct bpf_map *map) {} in bpf_cgroup_storage_release()
371 static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, in bpf_percpu_cgroup_storage_copy()
375 static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map, in bpf_percpu_cgroup_storage_update()
/Linux-v5.4/kernel/bpf/
Dmap_in_map.h10 struct bpf_map;
12 struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
13 void bpf_map_meta_free(struct bpf_map *map_meta);
14 bool bpf_map_meta_equal(const struct bpf_map *meta0,
15 const struct bpf_map *meta1);
16 void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
Dqueue_stack_maps.c17 struct bpf_map map;
25 static struct bpf_queue_stack *bpf_queue_stack(struct bpf_map *map) in bpf_queue_stack()
67 static struct bpf_map *queue_stack_map_alloc(union bpf_attr *attr) in queue_stack_map_alloc()
100 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free()
114 static int __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get()
143 static int __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get()
175 static int queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem()
181 static int stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem()
187 static int queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem()
193 static int stack_map_pop_elem(struct bpf_map *map, void *value) in stack_map_pop_elem()
[all …]
Darraymap.c71 static struct bpf_map *array_map_alloc(union bpf_attr *attr) in array_map_alloc()
143 static void *array_map_lookup_elem(struct bpf_map *map, void *key) in array_map_lookup_elem()
154 static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, in array_map_direct_value_addr()
168 static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, in array_map_direct_value_meta()
185 static u32 array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in array_map_gen_lookup()
215 static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) in percpu_array_map_lookup_elem()
226 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_array_copy()
253 static int array_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in array_map_get_next_key()
272 static int array_map_update_elem(struct bpf_map *map, void *key, void *value, in array_map_update_elem()
309 int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value, in bpf_percpu_array_update()
[all …]
Dmap_in_map.c9 struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd) in bpf_map_meta_alloc()
11 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_meta_alloc()
72 void bpf_map_meta_free(struct bpf_map *map_meta) in bpf_map_meta_free()
77 bool bpf_map_meta_equal(const struct bpf_map *meta0, in bpf_map_meta_equal()
78 const struct bpf_map *meta1) in bpf_map_meta_equal()
88 void *bpf_map_fd_get_ptr(struct bpf_map *map, in bpf_map_fd_get_ptr()
92 struct bpf_map *inner_map; in bpf_map_fd_get_ptr()
119 return ((struct bpf_map *)ptr)->id; in bpf_map_fd_sys_lookup_elem()
Dxskmap.c13 struct bpf_map map;
21 struct bpf_map *m = &map->map; in xsk_map_inc()
81 static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) in xsk_map_alloc()
135 static void xsk_map_free(struct bpf_map *map) in xsk_map_free()
146 static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in xsk_map_get_next_key()
163 struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, u32 key) in __xsk_map_lookup_elem()
175 int __xsk_map_redirect(struct bpf_map *map, struct xdp_buff *xdp, in __xsk_map_redirect()
192 void __xsk_map_flush(struct bpf_map *map) in __xsk_map_flush()
204 static void *xsk_map_lookup_elem(struct bpf_map *map, void *key) in xsk_map_lookup_elem()
210 static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key) in xsk_map_lookup_elem_sys_only()
[all …]
Dhashtab.c26 struct bpf_map map;
90 static void *fd_htab_map_get_ptr(const struct bpf_map *map, struct htab_elem *l) in fd_htab_map_get_ptr()
295 static struct bpf_map *htab_map_alloc(union bpf_attr *attr) in htab_map_alloc()
461 static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) in __htab_map_lookup_elem()
482 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem()
503 static u32 htab_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in htab_map_gen_lookup()
509 (void *(*)(struct bpf_map *map, void *key))NULL)); in htab_map_gen_lookup()
518 static __always_inline void *__htab_lru_map_lookup_elem(struct bpf_map *map, in __htab_lru_map_lookup_elem()
532 static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem()
537 static void *htab_lru_map_lookup_elem_sys(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem_sys()
[all …]
Dlocal_storage.c20 struct bpf_map map;
28 static struct bpf_cgroup_storage_map *map_to_storage(struct bpf_map *map) in map_to_storage()
114 static void *cgroup_storage_lookup_elem(struct bpf_map *_map, void *_key) in cgroup_storage_lookup_elem()
127 static int cgroup_storage_update_elem(struct bpf_map *map, void *_key, in cgroup_storage_update_elem()
170 int bpf_percpu_cgroup_storage_copy(struct bpf_map *_map, void *_key, in bpf_percpu_cgroup_storage_copy()
200 int bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *_key, in bpf_percpu_cgroup_storage_update()
235 static int cgroup_storage_get_next_key(struct bpf_map *_map, void *_key, in cgroup_storage_get_next_key()
271 static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) in cgroup_storage_map_alloc()
318 static void cgroup_storage_map_free(struct bpf_map *_map) in cgroup_storage_map_free()
328 static int cgroup_storage_delete_elem(struct bpf_map *map, void *key) in cgroup_storage_delete_elem()
[all …]
Dreuseport_array.c11 struct bpf_map map;
15 static struct reuseport_array *reuseport_array(struct bpf_map *map) in reuseport_array()
49 static void *reuseport_array_lookup_elem(struct bpf_map *map, void *key) in reuseport_array_lookup_elem()
61 static int reuseport_array_delete_elem(struct bpf_map *map, void *key) in reuseport_array_delete_elem()
93 static void reuseport_array_free(struct bpf_map *map) in reuseport_array_free()
150 static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) in reuseport_array_alloc()
181 int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_lookup_elem()
248 int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_update_elem()
334 static int reuseport_array_get_next_key(struct bpf_map *map, void *key, in reuseport_array_get_next_key()
Ddevmap.c76 struct bpf_map map;
171 static struct bpf_map *dev_map_alloc(union bpf_attr *attr) in dev_map_alloc()
196 static void dev_map_free(struct bpf_map *map) in dev_map_free()
249 static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in dev_map_get_next_key()
272 struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_hash_lookup_elem()
285 static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, in dev_map_hash_get_next_key()
386 void __dev_map_flush(struct bpf_map *map) in __dev_map_flush()
402 struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_lookup_elem()
477 static void *dev_map_lookup_elem(struct bpf_map *map, void *key) in dev_map_lookup_elem()
485 static void *dev_map_hash_lookup_elem(struct bpf_map *map, void *key) in dev_map_hash_lookup_elem()
[all …]
Dhelpers.c26 BPF_CALL_2(bpf_map_lookup_elem, struct bpf_map *, map, void *, key) in BPF_CALL_2() argument
41 BPF_CALL_4(bpf_map_update_elem, struct bpf_map *, map, void *, key, in BPF_CALL_4() argument
59 BPF_CALL_2(bpf_map_delete_elem, struct bpf_map *, map, void *, key) in BPF_CALL_2() argument
74 BPF_CALL_3(bpf_map_push_elem, struct bpf_map *, map, void *, value, u64, flags) in BPF_CALL_3() argument
89 BPF_CALL_2(bpf_map_pop_elem, struct bpf_map *, map, void *, value) in BPF_CALL_2() argument
102 BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) in BPF_CALL_2() argument
299 void copy_map_value_locked(struct bpf_map *map, void *dst, void *src, in copy_map_value_locked()
333 BPF_CALL_2(bpf_get_local_storage, struct bpf_map *, map, u64, flags) in BPF_CALL_2() argument
Dstackmap.c26 struct bpf_map map;
50 static inline bool stack_map_use_build_id(struct bpf_map *map) in stack_map_use_build_id()
55 static inline int stack_map_data_size(struct bpf_map *map) in stack_map_data_size()
85 static struct bpf_map *stack_map_alloc(union bpf_attr *attr) in stack_map_alloc()
345 BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map, in BPF_CALL_3() argument
513 static void *stack_map_lookup_elem(struct bpf_map *map, void *key) in stack_map_lookup_elem()
519 int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value) in bpf_stackmap_copy()
542 static int stack_map_get_next_key(struct bpf_map *map, void *key, in stack_map_get_next_key()
571 static int stack_map_update_elem(struct bpf_map *map, void *key, void *value, in stack_map_update_elem()
578 static int stack_map_delete_elem(struct bpf_map *map, void *key) in stack_map_delete_elem()
[all …]
Dsyscall.c100 static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) in find_and_alloc_map()
104 struct bpf_map *map; in find_and_alloc_map()
176 void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr) in bpf_map_init_from_attr()
240 int bpf_map_charge_memlock(struct bpf_map *map, u32 pages) in bpf_map_charge_memlock()
251 void bpf_map_uncharge_memlock(struct bpf_map *map, u32 pages) in bpf_map_uncharge_memlock()
257 static int bpf_map_alloc_id(struct bpf_map *map) in bpf_map_alloc_id()
275 void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock) in bpf_map_free_id()
304 struct bpf_map *map = container_of(work, struct bpf_map, work); in bpf_map_free_deferred()
314 static void bpf_map_put_uref(struct bpf_map *map) in bpf_map_put_uref()
325 static void __bpf_map_put(struct bpf_map *map, bool do_idr_lock) in __bpf_map_put()
[all …]
Dcpumap.c72 struct bpf_map map;
80 static struct bpf_map *cpu_map_alloc(union bpf_attr *attr) in cpu_map_alloc()
455 static int cpu_map_delete_elem(struct bpf_map *map, void *key) in cpu_map_delete_elem()
468 static int cpu_map_update_elem(struct bpf_map *map, void *key, void *value, in cpu_map_update_elem()
507 static void cpu_map_free(struct bpf_map *map) in cpu_map_free()
555 struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) in __cpu_map_lookup_elem()
567 static void *cpu_map_lookup_elem(struct bpf_map *map, void *key) in cpu_map_lookup_elem()
575 static int cpu_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in cpu_map_get_next_key()
684 void __cpu_map_flush(struct bpf_map *map) in __cpu_map_flush()
Dlpm_trie.c32 struct bpf_map map;
227 static void *trie_lookup_elem(struct bpf_map *map, void *_key) in trie_lookup_elem()
300 static int trie_update_elem(struct bpf_map *map, in trie_update_elem()
431 static int trie_delete_elem(struct bpf_map *map, void *_key) in trie_delete_elem()
540 static struct bpf_map *trie_alloc(union bpf_attr *attr) in trie_alloc()
586 static void trie_free(struct bpf_map *map) in trie_free()
630 static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key) in trie_get_next_key()
728 static int trie_check_btf(const struct bpf_map *map, in trie_check_btf()
Doffload.c362 struct bpf_map *bpf_map_offload_map_alloc(union bpf_attr *attr) in bpf_map_offload_map_alloc()
420 void bpf_map_offload_map_free(struct bpf_map *map) in bpf_map_offload_map_free()
434 int bpf_map_offload_lookup_elem(struct bpf_map *map, void *key, void *value) in bpf_map_offload_lookup_elem()
447 int bpf_map_offload_update_elem(struct bpf_map *map, in bpf_map_offload_update_elem()
465 int bpf_map_offload_delete_elem(struct bpf_map *map, void *key) in bpf_map_offload_delete_elem()
478 int bpf_map_offload_get_next_key(struct bpf_map *map, void *key, void *next_key) in bpf_map_offload_get_next_key()
521 int bpf_map_offload_info_fill(struct bpf_map_info *info, struct bpf_map *map) in bpf_map_offload_info_fill()
579 bool bpf_offload_prog_map_match(struct bpf_prog *prog, struct bpf_map *map) in bpf_offload_prog_map_match()
/Linux-v5.4/tools/lib/bpf/
Dlibbpf.h298 struct bpf_map;
299 LIBBPF_API struct bpf_map *
309 LIBBPF_API struct bpf_map *
312 LIBBPF_API struct bpf_map *
313 bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj);
320 LIBBPF_API struct bpf_map *
321 bpf_map__prev(const struct bpf_map *map, const struct bpf_object *obj);
323 LIBBPF_API int bpf_map__fd(const struct bpf_map *map);
324 LIBBPF_API const struct bpf_map_def *bpf_map__def(const struct bpf_map *map);
325 LIBBPF_API const char *bpf_map__name(const struct bpf_map *map);
[all …]
/Linux-v5.4/tools/perf/include/bpf/
Dbpf.h11 struct bpf_map { struct
21 #define bpf_map(name, _type, type_key, type_val, _max_entries) \ argument
22 struct bpf_map SEC("maps") name = { \
43 #define pid_map(name, value_type) bpf_map(name, HASH, pid_t, value_type, 64)
45 static int (*bpf_map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags) = (void *…
46 static void *(*bpf_map_lookup_elem)(struct bpf_map *map, void *key) = (void *)BPF_FUNC_map_lookup_e…
68 static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) = (void *)BPF…
Dpid_filter.h10 static int pid_filter__add(struct bpf_map *pids, pid_t pid) in pid_filter__add()
16 static bool pid_filter__has(struct bpf_map *pids, pid_t pid) in pid_filter__has()
/Linux-v5.4/net/core/
Dsock_map.c15 struct bpf_map map;
24 static struct bpf_map *sock_map_alloc(union bpf_attr *attr) in sock_map_alloc()
66 struct bpf_map *map; in sock_map_get_from_fd()
97 struct bpf_map *map, void *link_raw) in sock_map_add_link()
115 struct bpf_map *map = link->map; in sock_map_del_link()
142 static int sock_map_link(struct bpf_map *map, struct sk_psock_progs *progs, in sock_map_link()
231 static void sock_map_free(struct bpf_map *map) in sock_map_free()
256 static void sock_map_release_progs(struct bpf_map *map) in sock_map_release_progs()
261 static struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) in __sock_map_lookup_elem()
272 static void *sock_map_lookup(struct bpf_map *map, void *key) in sock_map_lookup()
[all …]
Dbpf_sk_storage.c42 struct bpf_map map;
299 sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit) in sk_storage_lookup()
388 struct bpf_map *map, in sk_storage_update()
501 static int sk_storage_delete(struct sock *sk, struct bpf_map *map) in sk_storage_delete()
553 static void bpf_sk_storage_map_free(struct bpf_map *map) in bpf_sk_storage_map_free()
633 static struct bpf_map *bpf_sk_storage_map_alloc(union bpf_attr *attr) in bpf_sk_storage_map_alloc()
677 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key()
683 static int bpf_sk_storage_map_check_btf(const struct bpf_map *map, in bpf_sk_storage_map_check_btf()
700 static void *bpf_fd_sk_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_lookup_elem()
717 static int bpf_fd_sk_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_sk_storage_update_elem()
[all …]
/Linux-v5.4/tools/perf/util/
Dbpf_map.h7 struct bpf_map;
11 int bpf_map__fprintf(struct bpf_map *map, FILE *fp);
15 static inline int bpf_map__fprintf(struct bpf_map *map __maybe_unused, FILE *fp __maybe_unused) in bpf_map__fprintf()
/Linux-v5.4/tools/perf/examples/bpf/
Daugmented_raw_syscalls.c23 bpf_map(__augmented_syscalls__, PERF_EVENT_ARRAY, int, u32, __NR_CPUS__);
35 bpf_map(syscalls, ARRAY, int, struct syscall, 512);
42 bpf_map(syscalls_sys_enter, PROG_ARRAY, u32, u32, 512);
49 bpf_map(syscalls_sys_exit, PROG_ARRAY, u32, u32, 512);
82 bpf_map(augmented_args_tmp, PERCPU_ARRAY, int, struct augmented_args_payload, 1);
/Linux-v5.4/include/trace/events/
Dxdp.h87 const struct bpf_map *map, u32 map_index),
122 const struct bpf_map *map, u32 map_index),
130 const struct bpf_map *map, u32 map_index),
144 const struct bpf_map *map, u32 map_index),
159 const struct bpf_map *map, u32 map_index),
262 TP_PROTO(const struct bpf_map *map, u32 map_index,

1234