/Linux-v5.15/tools/testing/selftests/bpf/progs/ |
D | map_ptr_kern.c | 30 struct bpf_map { struct 38 static inline int check_bpf_map_fields(struct bpf_map *map, __u32 key_size, in check_bpf_map_fields() argument 50 static inline int check_bpf_map_ptr(struct bpf_map *indirect, in check_bpf_map_ptr() 51 struct bpf_map *direct) in check_bpf_map_ptr() 62 static inline int check(struct bpf_map *indirect, struct bpf_map *direct, in check() 71 static inline int check_default(struct bpf_map *indirect, in check_default() 72 struct bpf_map *direct) in check_default() 80 check_default_noinline(struct bpf_map *indirect, struct bpf_map *direct) in check_default_noinline() 92 struct bpf_map map; 109 struct bpf_map *map = (struct bpf_map *)&m_hash; in check_hash() [all …]
|
D | bpf_iter.h | 82 struct bpf_map *map; 116 struct bpf_map *map; 123 struct bpf_map *map; 130 struct bpf_map *map;
|
/Linux-v5.15/include/linux/ |
D | bpf.h | 32 struct bpf_map; 65 struct bpf_map *(*map_alloc)(union bpf_attr *attr); 66 void (*map_release)(struct bpf_map *map, struct file *map_file); 67 void (*map_free)(struct bpf_map *map); 68 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); 69 void (*map_release_uref)(struct bpf_map *map); 70 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key); 71 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr, 73 int (*map_lookup_and_delete_elem)(struct bpf_map *map, void *key, 75 int (*map_lookup_and_delete_batch)(struct bpf_map *map, [all …]
|
/Linux-v5.15/tools/lib/bpf/ |
D | libbpf.h | 343 struct bpf_map; 345 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(struct bpf_map *map); 485 LIBBPF_API struct bpf_map * 495 LIBBPF_API struct bpf_map * 498 LIBBPF_API struct bpf_map * 499 bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj); 506 LIBBPF_API struct bpf_map * 507 bpf_map__prev(const struct bpf_map *map, const struct bpf_object *obj); 510 LIBBPF_API int bpf_map__fd(const struct bpf_map *map); 511 LIBBPF_API int bpf_map__reuse_fd(struct bpf_map *map, int fd); [all …]
|
/Linux-v5.15/kernel/bpf/ |
D | queue_stack_maps.c | 17 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() 92 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free() 99 static int __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get() 128 static int __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() 160 static int queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() 166 static int stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() 172 static int queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() 178 static int stack_map_pop_elem(struct bpf_map *map, void *value) in stack_map_pop_elem() [all …]
|
D | arraymap.c | 81 static struct bpf_map *array_map_alloc(union bpf_attr *attr) in array_map_alloc() 159 static void *array_map_lookup_elem(struct bpf_map *map, void *key) in array_map_lookup_elem() 170 static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, in array_map_direct_value_addr() 184 static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, in array_map_direct_value_meta() 201 static int array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in array_map_gen_lookup() 234 static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) in percpu_array_map_lookup_elem() 245 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_array_copy() 272 static int array_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in array_map_get_next_key() 297 static int array_map_update_elem(struct bpf_map *map, void *key, void *value, in array_map_update_elem() 335 int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value, in bpf_percpu_array_update() [all …]
|
D | map_in_map.c | 10 struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd) in bpf_map_meta_alloc() 12 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() 78 bool bpf_map_meta_equal(const struct bpf_map *meta0, in bpf_map_meta_equal() 79 const struct bpf_map *meta1) in bpf_map_meta_equal() 89 void *bpf_map_fd_get_ptr(struct bpf_map *map, in bpf_map_fd_get_ptr() 93 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_fd_get_ptr() 121 return ((struct bpf_map *)ptr)->id; in bpf_map_fd_sys_lookup_elem()
|
D | map_iter.c | 16 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)
|
D | bpf_inode_storage.c | 36 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() 142 static int inode_storage_delete(struct inode *inode, struct bpf_map *map) in inode_storage_delete() 155 static int bpf_fd_inode_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_delete_elem() 170 BPF_CALL_4(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, in BPF_CALL_4() argument 205 struct bpf_map *, map, struct inode *, inode) in BPF_CALL_2() argument 216 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() 222 static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr) in inode_storage_map_alloc() 234 static void inode_storage_map_free(struct bpf_map *map) in inode_storage_map_free()
|
D | map_in_map.h | 10 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,
|
D | bpf_task_storage.c | 56 task_storage_lookup(struct task_struct *task, struct bpf_map *map, in task_storage_lookup() 116 static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_lookup_elem() 149 static int bpf_pid_task_storage_update_elem(struct bpf_map *map, void *key, in bpf_pid_task_storage_update_elem() 184 static int task_storage_delete(struct task_struct *task, struct bpf_map *map) in task_storage_delete() 197 static int bpf_pid_task_storage_delete_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_delete_elem() 227 BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, in BPF_CALL_4() argument 258 BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, map, struct task_struct *, in BPF_CALL_2() argument 278 static int notsupp_get_next_key(struct bpf_map *map, void *key, void *next_key) in notsupp_get_next_key() 283 static struct bpf_map *task_storage_map_alloc(union bpf_attr *attr) in task_storage_map_alloc() 295 static void task_storage_map_free(struct bpf_map *map) in task_storage_map_free()
|
D | local_storage.c | 21 struct bpf_map map; 28 static struct bpf_cgroup_storage_map *map_to_storage(struct bpf_map *map) in map_to_storage() 33 static bool attach_type_isolated(const struct bpf_map *map) in attach_type_isolated() 131 static void *cgroup_storage_lookup_elem(struct bpf_map *_map, void *key) in cgroup_storage_lookup_elem() 143 static int cgroup_storage_update_elem(struct bpf_map *map, void *key, in cgroup_storage_update_elem() 182 int bpf_percpu_cgroup_storage_copy(struct bpf_map *_map, void *key, in bpf_percpu_cgroup_storage_copy() 211 int bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *key, in bpf_percpu_cgroup_storage_update() 245 static int cgroup_storage_get_next_key(struct bpf_map *_map, void *key, in cgroup_storage_get_next_key() 285 static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) in cgroup_storage_map_alloc() 331 static void cgroup_storage_map_free(struct bpf_map *_map) in cgroup_storage_map_free() [all …]
|
D | hashtab.c | 93 struct bpf_map map; 221 static void *fd_htab_map_get_ptr(const struct bpf_map *map, struct htab_elem *l) in fd_htab_map_get_ptr() 462 static struct bpf_map *htab_map_alloc(union bpf_attr *attr) in htab_map_alloc() 622 static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) in __htab_map_lookup_elem() 643 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem() 664 static int htab_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in htab_map_gen_lookup() 670 (void *(*)(struct bpf_map *map, void *key))NULL)); in htab_map_gen_lookup() 679 static __always_inline void *__htab_lru_map_lookup_elem(struct bpf_map *map, in __htab_lru_map_lookup_elem() 693 static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem() 698 static void *htab_lru_map_lookup_elem_sys(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem_sys() [all …]
|
D | ringbuf.c | 51 struct bpf_map map; 148 static struct bpf_map *ringbuf_map_alloc(union bpf_attr *attr) in ringbuf_map_alloc() 195 static void ringbuf_map_free(struct bpf_map *map) in ringbuf_map_free() 204 static void *ringbuf_map_lookup_elem(struct bpf_map *map, void *key) in ringbuf_map_lookup_elem() 209 static int ringbuf_map_update_elem(struct bpf_map *map, void *key, void *value, in ringbuf_map_update_elem() 215 static int ringbuf_map_delete_elem(struct bpf_map *map, void *key) in ringbuf_map_delete_elem() 220 static int ringbuf_map_get_next_key(struct bpf_map *map, void *key, in ringbuf_map_get_next_key() 226 static int ringbuf_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) in ringbuf_map_mmap() 253 static __poll_t ringbuf_map_poll(struct bpf_map *map, struct file *filp, in ringbuf_map_poll() 351 BPF_CALL_3(bpf_ringbuf_reserve, struct bpf_map *, map, u64, size, u64, flags) in BPF_CALL_3() argument [all …]
|
D | reuseport_array.c | 11 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() 174 int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_lookup_elem() 241 int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_update_elem() 325 static int reuseport_array_get_next_key(struct bpf_map *map, void *key, in reuseport_array_get_next_key()
|
D | devmap.c | 75 struct bpf_map map; 157 static struct bpf_map *dev_map_alloc(union bpf_attr *attr) in dev_map_alloc() 182 static void dev_map_free(struct bpf_map *map) in dev_map_free() 245 static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in dev_map_get_next_key() 266 static void *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_hash_lookup_elem() 280 static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, in dev_map_hash_get_next_key() 428 static void *__dev_map_lookup_elem(struct bpf_map *map, u32 key) in __dev_map_lookup_elem() 590 struct bpf_map *map, bool exclude_ingress) in dev_map_enqueue_multi() 711 struct bpf_prog *xdp_prog, struct bpf_map *map, in dev_map_redirect_multi() 786 static void *dev_map_lookup_elem(struct bpf_map *map, void *key) in dev_map_lookup_elem() [all …]
|
D | stackmap.c | 27 struct bpf_map map; 53 static inline bool stack_map_use_build_id(struct bpf_map *map) in stack_map_use_build_id() 58 static inline int stack_map_data_size(struct bpf_map *map) in stack_map_data_size() 89 static struct bpf_map *stack_map_alloc(union bpf_attr *attr) in stack_map_alloc() 259 static long __bpf_get_stackid(struct bpf_map *map, in __bpf_get_stackid() 337 BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map, in BPF_CALL_3() argument 383 struct bpf_map *, map, u64, flags) in BPF_CALL_3() argument 615 static void *stack_map_lookup_elem(struct bpf_map *map, void *key) in stack_map_lookup_elem() 621 int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value) in bpf_stackmap_copy() 644 static int stack_map_get_next_key(struct bpf_map *map, void *key, in stack_map_get_next_key() [all …]
|
D | syscall.c | 106 static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) in find_and_alloc_map() 110 struct bpf_map *map; in find_and_alloc_map() 135 static u32 bpf_map_value_size(const struct bpf_map *map) in bpf_map_value_size() 148 static void maybe_wait_bpf_programs(struct bpf_map *map) in maybe_wait_bpf_programs() 159 static int bpf_map_update_value(struct bpf_map *map, struct fd f, void *key, in bpf_map_update_value() 215 static int bpf_map_copy_value(struct bpf_map *map, void *key, void *value, in bpf_map_copy_value() 343 void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr) in bpf_map_init_from_attr() 353 static int bpf_map_alloc_id(struct bpf_map *map) in bpf_map_alloc_id() 371 void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock) in bpf_map_free_id() 398 static void bpf_map_save_memcg(struct bpf_map *map) in bpf_map_save_memcg() [all …]
|
D | bpf_struct_ops.c | 30 struct bpf_map map; 232 static int bpf_struct_ops_map_get_next_key(struct bpf_map *map, void *key, in bpf_struct_ops_map_get_next_key() 242 int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_sys_lookup_elem() 271 static void *bpf_struct_ops_map_lookup_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_lookup_elem() 315 static int bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_update_elem() 486 static int bpf_struct_ops_map_delete_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_delete_elem() 512 static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_seq_show_elem() 532 static void bpf_struct_ops_map_free(struct bpf_map *map) in bpf_struct_ops_map_free() 552 static struct bpf_map *bpf_struct_ops_map_alloc(union bpf_attr *attr) in bpf_struct_ops_map_alloc() 558 struct bpf_map *map; in bpf_struct_ops_map_alloc()
|
/Linux-v5.15/tools/perf/include/bpf/ |
D | bpf.h | 11 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.15/net/xdp/ |
D | xskmap.c | 59 static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) in xsk_map_alloc() 86 static void xsk_map_free(struct bpf_map *map) in xsk_map_free() 94 static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in xsk_map_get_next_key() 111 static int xsk_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in xsk_map_gen_lookup() 131 static void *__xsk_map_lookup_elem(struct bpf_map *map, u32 key) in __xsk_map_lookup_elem() 141 static void *xsk_map_lookup_elem(struct bpf_map *map, void *key) in xsk_map_lookup_elem() 146 static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key) in xsk_map_lookup_elem_sys_only() 151 static int xsk_map_update_elem(struct bpf_map *map, void *key, void *value, in xsk_map_update_elem() 212 static int xsk_map_delete_elem(struct bpf_map *map, void *key) in xsk_map_delete_elem() 232 static int xsk_map_redirect(struct bpf_map *map, u32 ifindex, u64 flags) in xsk_map_redirect() [all …]
|
/Linux-v5.15/net/core/ |
D | sock_map.c | 18 struct bpf_map map; 27 static int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, 29 static struct sk_psock_progs *sock_map_progs(struct bpf_map *map); 31 static struct bpf_map *sock_map_alloc(union bpf_attr *attr) in sock_map_alloc() 65 struct bpf_map *map; in sock_map_get_from_fd() 85 struct bpf_map *map; in sock_map_prog_detach() 134 struct bpf_map *map, void *link_raw) in sock_map_add_link() 152 struct bpf_map *map = link->map; in sock_map_del_link() 214 static int sock_map_link(struct bpf_map *map, struct sock *sk) in sock_map_link() 326 static void sock_map_free(struct bpf_map *map) in sock_map_free() [all …]
|
D | bpf_sk_storage.c | 20 bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit) in bpf_sk_storage_lookup() 33 static int bpf_sk_storage_del(struct sock *sk, struct bpf_map *map) in bpf_sk_storage_del() 86 static void bpf_sk_storage_map_free(struct bpf_map *map) in bpf_sk_storage_map_free() 95 static struct bpf_map *bpf_sk_storage_map_alloc(union bpf_attr *attr) in bpf_sk_storage_map_alloc() 107 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() 113 static void *bpf_fd_sk_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_lookup_elem() 130 static int bpf_fd_sk_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_sk_storage_update_elem() 150 static int bpf_fd_sk_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_delete_elem() 205 struct bpf_map *map; in bpf_sk_storage_clone() 256 BPF_CALL_4(bpf_sk_storage_get, struct bpf_map *, map, struct sock *, sk, in BPF_CALL_4() argument [all …]
|
/Linux-v5.15/tools/perf/util/ |
D | bpf_map.h | 7 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.15/tools/perf/examples/bpf/ |
D | augmented_raw_syscalls.c | 23 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);
|