Home
last modified time | relevance | path

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

12345

/Linux-v5.10/tools/testing/selftests/bpf/progs/
Dmap_ptr_kern.c33 struct bpf_map { struct
42 static inline int check_bpf_map_fields(struct bpf_map *map, __u32 key_size, in check_bpf_map_fields() argument
55 static inline int check_bpf_map_ptr(struct bpf_map *indirect, in check_bpf_map_ptr()
56 struct bpf_map *direct) in check_bpf_map_ptr()
68 static inline int check(struct bpf_map *indirect, struct bpf_map *direct, in check()
77 static inline int check_default(struct bpf_map *indirect, in check_default()
78 struct bpf_map *direct) in check_default()
86 check_default_noinline(struct bpf_map *indirect, struct bpf_map *direct) in check_default_noinline()
98 struct bpf_map map;
115 struct bpf_map *map = (struct bpf_map *)&m_hash; in check_hash()
[all …]
Dbpf_iter.h72 struct bpf_map *map;
100 struct bpf_map *map;
107 struct bpf_map *map;
114 struct bpf_map *map;
/Linux-v5.10/include/linux/
Dbpf.h29 struct bpf_map;
57 struct bpf_map *(*map_alloc)(union bpf_attr *attr);
58 void (*map_release)(struct bpf_map *map, struct file *map_file);
59 void (*map_free)(struct bpf_map *map);
60 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);
61 void (*map_release_uref)(struct bpf_map *map);
62 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key);
63 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr,
65 int (*map_lookup_and_delete_batch)(struct bpf_map *map,
68 int (*map_update_batch)(struct bpf_map *map, const union bpf_attr *attr,
[all …]
Dbpf-cgroup.h17 struct bpf_map;
151 struct bpf_map *map) in cgroup_storage_type()
178 int bpf_cgroup_storage_assign(struct bpf_prog_aux *aux, struct bpf_map *map);
180 int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value);
181 int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
416 struct bpf_map *map) { return 0; } in bpf_cgroup_storage_assign()
421 static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, in bpf_percpu_cgroup_storage_copy()
425 static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map, in bpf_percpu_cgroup_storage_update()
/Linux-v5.10/tools/lib/bpf/
Dlibbpf.h268 struct bpf_map;
270 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(struct bpf_map *map);
410 LIBBPF_API struct bpf_map *
420 LIBBPF_API struct bpf_map *
423 LIBBPF_API struct bpf_map *
424 bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj);
431 LIBBPF_API struct bpf_map *
432 bpf_map__prev(const struct bpf_map *map, const struct bpf_object *obj);
435 LIBBPF_API int bpf_map__fd(const struct bpf_map *map);
436 LIBBPF_API int bpf_map__reuse_fd(struct bpf_map *map, int fd);
[all …]
/Linux-v5.10/kernel/bpf/
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()
107 static int __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get()
136 static int __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get()
168 static int queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem()
174 static int stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem()
180 static int queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem()
186 static int stack_map_pop_elem(struct bpf_map *map, void *value) in stack_map_pop_elem()
[all …]
Darraymap.c81 static struct bpf_map *array_map_alloc(union bpf_attr *attr) in array_map_alloc()
175 static void *array_map_lookup_elem(struct bpf_map *map, void *key) in array_map_lookup_elem()
186 static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, in array_map_direct_value_addr()
200 static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, in array_map_direct_value_meta()
217 static int array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in array_map_gen_lookup()
250 static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) in percpu_array_map_lookup_elem()
261 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_array_copy()
288 static int array_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in array_map_get_next_key()
307 static int array_map_update_elem(struct bpf_map *map, void *key, void *value, in array_map_update_elem()
344 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()
66 void bpf_map_meta_free(struct bpf_map *map_meta) in bpf_map_meta_free()
71 bool bpf_map_meta_equal(const struct bpf_map *meta0, in bpf_map_meta_equal()
72 const struct bpf_map *meta1) in bpf_map_meta_equal()
81 void *bpf_map_fd_get_ptr(struct bpf_map *map, in bpf_map_fd_get_ptr()
85 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_fd_get_ptr()
113 return ((struct bpf_map *)ptr)->id; in bpf_map_fd_sys_lookup_elem()
Dbpf_inode_storage.c36 struct bpf_map *map, in inode_storage_lookup()
103 static void *bpf_fd_inode_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_lookup_elem()
119 static int bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_inode_storage_update_elem()
138 static int inode_storage_delete(struct inode *inode, struct bpf_map *map) in inode_storage_delete()
151 static int bpf_fd_inode_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_delete_elem()
166 BPF_CALL_4(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, in BPF_CALL_4() argument
201 struct bpf_map *, map, struct inode *, inode) in BPF_CALL_2() argument
209 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key()
215 static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr) in inode_storage_map_alloc()
227 static void inode_storage_map_free(struct bpf_map *map) in inode_storage_map_free()
Dmap_iter.c16 struct bpf_map *map; in bpf_map_seq_start()
33 bpf_map_put((struct bpf_map *)v); in bpf_map_seq_next()
39 __bpf_md_ptr(struct bpf_map *, map);
42 DEFINE_BPF_ITER_FUNC(bpf_map, struct bpf_iter_meta *meta, struct bpf_map *map) in DEFINE_BPF_ITER_FUNC() argument
71 bpf_map_put((struct bpf_map *)v); in bpf_map_seq_stop()
82 BTF_ID(struct, bpf_map)
106 struct bpf_map *map; in bpf_iter_attach_map()
166 struct bpf_map *map, void *key, void *value)
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 void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
Dlocal_storage.c22 struct bpf_map map;
29 static struct bpf_cgroup_storage_map *map_to_storage(struct bpf_map *map) in map_to_storage()
34 static bool attach_type_isolated(const struct bpf_map *map) in attach_type_isolated()
132 static void *cgroup_storage_lookup_elem(struct bpf_map *_map, void *key) in cgroup_storage_lookup_elem()
144 static int cgroup_storage_update_elem(struct bpf_map *map, void *key, in cgroup_storage_update_elem()
183 int bpf_percpu_cgroup_storage_copy(struct bpf_map *_map, void *key, in bpf_percpu_cgroup_storage_copy()
212 int bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *key, in bpf_percpu_cgroup_storage_update()
246 static int cgroup_storage_get_next_key(struct bpf_map *_map, void *key, in cgroup_storage_get_next_key()
286 static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) in cgroup_storage_map_alloc()
334 static void cgroup_storage_map_free(struct bpf_map *_map) in cgroup_storage_map_free()
[all …]
Dhashtab.c90 struct bpf_map map;
195 static void *fd_htab_map_get_ptr(const struct bpf_map *map, struct htab_elem *l) in fd_htab_map_get_ptr()
411 static struct bpf_map *htab_map_alloc(union bpf_attr *attr) in htab_map_alloc()
574 static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) in __htab_map_lookup_elem()
594 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem()
615 static int htab_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in htab_map_gen_lookup()
621 (void *(*)(struct bpf_map *map, void *key))NULL)); in htab_map_gen_lookup()
630 static __always_inline void *__htab_lru_map_lookup_elem(struct bpf_map *map, in __htab_lru_map_lookup_elem()
644 static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem()
649 static void *htab_lru_map_lookup_elem_sys(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem_sys()
[all …]
Dreuseport_array.c11 struct bpf_map map;
15 static struct reuseport_array *reuseport_array(struct bpf_map *map) in reuseport_array()
52 static void *reuseport_array_lookup_elem(struct bpf_map *map, void *key) in reuseport_array_lookup_elem()
64 static int reuseport_array_delete_elem(struct bpf_map *map, void *key) in reuseport_array_delete_elem()
96 static void reuseport_array_free(struct bpf_map *map) in reuseport_array_free()
151 static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) in reuseport_array_alloc()
182 int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_lookup_elem()
249 int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_update_elem()
333 static int reuseport_array_get_next_key(struct bpf_map *map, void *key, in reuseport_array_get_next_key()
Dringbuf.c50 struct bpf_map map;
150 static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr) in ringbuf_map_alloc()
212 static void ringbuf_map_free(struct bpf_map *map) in ringbuf_map_free()
221 static void *ringbuf_map_lookup_elem(struct bpf_map *map, void *key) in ringbuf_map_lookup_elem()
226 static int ringbuf_map_update_elem(struct bpf_map *map, void *key, void *value, in ringbuf_map_update_elem()
232 static int ringbuf_map_delete_elem(struct bpf_map *map, void *key) in ringbuf_map_delete_elem()
237 static int ringbuf_map_get_next_key(struct bpf_map *map, void *key, in ringbuf_map_get_next_key()
251 static int ringbuf_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) in ringbuf_map_mmap()
275 static __poll_t ringbuf_map_poll(struct bpf_map *map, struct file *filp, in ringbuf_map_poll()
370 BPF_CALL_3(bpf_ringbuf_reserve, struct bpf_map *, map, u64, size, u64, flags) in BPF_CALL_3() argument
[all …]
Ddevmap.c74 struct bpf_map map;
170 static struct bpf_map *dev_map_alloc(union bpf_attr *attr) in dev_map_alloc()
195 static void dev_map_free(struct bpf_map *map) in dev_map_free()
258 static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in dev_map_get_next_key()
275 struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_hash_lookup_elem()
289 static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, in dev_map_hash_get_next_key()
334 bool dev_map_can_have_prog(struct bpf_map *map) in dev_map_can_have_prog()
409 struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_lookup_elem()
528 static void *dev_map_lookup_elem(struct bpf_map *map, void *key) in dev_map_lookup_elem()
535 static void *dev_map_hash_lookup_elem(struct bpf_map *map, void *key) in dev_map_hash_lookup_elem()
[all …]
Dbpf_struct_ops.c30 struct bpf_map map;
231 static int bpf_struct_ops_map_get_next_key(struct bpf_map *map, void *key, in bpf_struct_ops_map_get_next_key()
241 int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_sys_lookup_elem()
270 static void *bpf_struct_ops_map_lookup_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_lookup_elem()
314 static int bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_update_elem()
482 static int bpf_struct_ops_map_delete_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_delete_elem()
508 static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_seq_show_elem()
528 static void bpf_struct_ops_map_free(struct bpf_map *map) in bpf_struct_ops_map_free()
548 static struct bpf_map *bpf_struct_ops_map_alloc(union bpf_attr *attr) in bpf_struct_ops_map_alloc()
555 struct bpf_map *map; in bpf_struct_ops_map_alloc()
Dsyscall.c101 static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) in find_and_alloc_map()
105 struct bpf_map *map; in find_and_alloc_map()
130 static u32 bpf_map_value_size(struct bpf_map *map) in bpf_map_value_size()
143 static void maybe_wait_bpf_programs(struct bpf_map *map) in maybe_wait_bpf_programs()
154 static int bpf_map_update_value(struct bpf_map *map, struct fd f, void *key, in bpf_map_update_value()
210 static int bpf_map_copy_value(struct bpf_map *map, void *key, void *value, in bpf_map_copy_value()
334 void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr) in bpf_map_init_from_attr()
398 int bpf_map_charge_memlock(struct bpf_map *map, u32 pages) in bpf_map_charge_memlock()
409 void bpf_map_uncharge_memlock(struct bpf_map *map, u32 pages) in bpf_map_uncharge_memlock()
415 static int bpf_map_alloc_id(struct bpf_map *map) in bpf_map_alloc_id()
[all …]
/Linux-v5.10/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…
/Linux-v5.10/net/core/
Dsock_map.c18 struct bpf_map map;
27 static struct bpf_map *sock_map_alloc(union bpf_attr *attr) in sock_map_alloc()
70 struct bpf_map *map; in sock_map_get_from_fd()
90 struct bpf_map *map; in sock_map_prog_detach()
139 struct bpf_map *map, void *link_raw) in sock_map_add_link()
157 struct bpf_map *map = link->map; in sock_map_del_link()
233 static int sock_map_link(struct bpf_map *map, struct sk_psock_progs *progs, in sock_map_link()
324 static int sock_map_link_no_progs(struct bpf_map *map, struct sock *sk) in sock_map_link_no_progs()
345 static void sock_map_free(struct bpf_map *map) in sock_map_free()
376 static void sock_map_release_progs(struct bpf_map *map) in sock_map_release_progs()
[all …]
Dbpf_sk_storage.c31 sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit) in sk_storage_lookup()
44 static int sk_storage_delete(struct sock *sk, struct bpf_map *map) in sk_storage_delete()
97 static void sk_storage_map_free(struct bpf_map *map) in sk_storage_map_free()
106 static struct bpf_map *sk_storage_map_alloc(union bpf_attr *attr) in sk_storage_map_alloc()
118 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key()
124 static void *bpf_fd_sk_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_lookup_elem()
141 static int bpf_fd_sk_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_sk_storage_update_elem()
161 static int bpf_fd_sk_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_delete_elem()
216 struct bpf_map *map; in bpf_sk_storage_clone()
267 BPF_CALL_4(bpf_sk_storage_get, struct bpf_map *, map, struct sock *, sk, in BPF_CALL_4() argument
[all …]
/Linux-v5.10/net/xdp/
Dxskmap.c74 static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) in xsk_map_alloc()
109 static void xsk_map_free(struct bpf_map *map) in xsk_map_free()
118 static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in xsk_map_get_next_key()
135 static int xsk_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in xsk_map_gen_lookup()
151 static void *xsk_map_lookup_elem(struct bpf_map *map, void *key) in xsk_map_lookup_elem()
157 static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key) in xsk_map_lookup_elem_sys_only()
162 static int xsk_map_update_elem(struct bpf_map *map, void *key, void *value, in xsk_map_update_elem()
222 static int xsk_map_delete_elem(struct bpf_map *map, void *key) in xsk_map_delete_elem()
252 static bool xsk_map_meta_equal(const struct bpf_map *meta0, in xsk_map_meta_equal()
253 const struct bpf_map *meta1) in xsk_map_meta_equal()
/Linux-v5.10/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.10/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.10/include/net/
Dxdp_sock.h38 struct bpf_map map;
87 static inline struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, in __xsk_map_lookup_elem()
116 static inline struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, in __xsk_map_lookup_elem()

12345