/linux/tools/testing/selftests/bpf/progs/ |
H A 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 *direc 31 map_typebpf_map global() argument [all...] |
H A D | bloom_filter_map.c | 10 struct bpf_map; 35 struct bpf_map *map; 41 check_elem(struct bpf_map *map, __u32 *key, __u32 *val, in check_elem() 58 struct bpf_map *inner_map; in inner_map() 79 data.map = (struct bpf_map *)&map_bloom; in check_bloom()
|
H A D | bloom_filter_bench.c | 12 struct bpf_map; 43 struct bpf_map *map; 71 bloom_callback(struct bpf_map *map, __u32 *key, void *val, in bloom_callback() 96 data.map = (struct bpf_map *)&bloom_map; in bloom_lookup() 109 data.map = (struct bpf_map *)&bloom_map; in bloom_update()
|
H A D | jeq_infer_not_null_fail.c | 24 struct bpf_map *map = (struct bpf_map *)&m_hash; in jeq_infer_not_null_ptr_to_btfid() 25 struct bpf_map *inner_map = map->inner_map_meta; in jeq_infer_not_null_ptr_to_btfid()
|
/linux/tools/lib/bpf/ |
H A D | libbpf.h | 897 struct bpf_map; 899 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(const struct bpf_map *map); 900 LIBBPF_API int bpf_link__update_map(struct bpf_link *link, const struct bpf_map *map); 989 LIBBPF_API struct bpf_map * 995 LIBBPF_API struct bpf_map * 996 bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *map); 1004 LIBBPF_API struct bpf_map * 1005 bpf_object__prev_map(const struct bpf_object *obj, const struct bpf_map *map); 1026 LIBBPF_API int bpf_map__set_autocreate(struct bpf_map *map, bool autocreate); 1027 LIBBPF_API bool bpf_map__autocreate(const struct bpf_map *ma [all...] |
/linux/kernel/bpf/ |
H A D | queue_stack_maps.c | 18 struct bpf_map map; 26 static struct bpf_queue_stack *bpf_queue_stack(struct bpf_map *map) in bpf_queue_stack() 65 static struct bpf_map *queue_stack_map_alloc(union bpf_attr *attr) in queue_stack_map_alloc() 88 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free() 95 static long __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get() 125 static long __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() 158 static long queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() 164 static long stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() 170 static long queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() 176 static long stack_map_pop_elem(struct bpf_map *ma [all...] |
H A 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() 48 struct bpf_map *ret = ERR_CAST(inner_map_meta->record); in bpf_map_meta_alloc() 76 void bpf_map_meta_free(struct bpf_map *map_meta) in bpf_map_meta_free() 83 bool bpf_map_meta_equal(const struct bpf_map *meta0, in bpf_map_meta_equal() 84 const struct bpf_map *meta1) in bpf_map_meta_equal() 94 void *bpf_map_fd_get_ptr(struct bpf_map *map, in bpf_map_fd_get_ptr() 98 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_fd_get_ptr() 114 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer) in bpf_map_fd_put_ptr() 116 struct bpf_map *inner_ma in bpf_map_fd_put_ptr() [all...] |
H A D | arraymap.c | 83 static struct bpf_map *array_map_alloc(union bpf_attr *attr) in array_map_alloc() 166 static void *array_map_lookup_elem(struct bpf_map *map, void *key) in array_map_lookup_elem() 177 static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, in array_map_direct_value_addr() 191 static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, in array_map_direct_value_meta() 208 static int array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in array_map_gen_lookup() 241 static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) in percpu_array_map_lookup_elem() 253 static int percpu_array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in percpu_array_map_gen_lookup() 284 static void *percpu_array_map_lookup_percpu_elem(struct bpf_map *map, void *key, u32 cpu) in percpu_array_map_lookup_percpu_elem() 298 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_array_copy() 326 static int array_map_get_next_key(struct bpf_map *ma [all...] |
H A D | bloom_filter.c | 16 struct bpf_map map; 36 static long bloom_map_peek_elem(struct bpf_map *map, void *value) in bloom_map_peek_elem() 51 static long bloom_map_push_elem(struct bpf_map *map, void *value, u64 flags) in bloom_map_push_elem() 68 static long bloom_map_pop_elem(struct bpf_map *map, void *value) in bloom_map_pop_elem() 73 static long bloom_map_delete_elem(struct bpf_map *map, void *value) in bloom_map_delete_elem() 78 static int bloom_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in bloom_map_get_next_key() 95 static struct bpf_map *bloom_map_alloc(union bpf_attr *attr) in bloom_map_alloc() 162 static void bloom_map_free(struct bpf_map *map) in bloom_map_free() 170 static void *bloom_map_lookup_elem(struct bpf_map *map, void *key) in bloom_map_lookup_elem() 176 static long bloom_map_update_elem(struct bpf_map *ma [all...] |
H A 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, 16 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer);
|
H A D | bpf_inode_storage.c | 36 struct bpf_map *map, in inode_storage_lookup() 78 static void *bpf_fd_inode_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_lookup_elem() 90 static long bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_inode_storage_update_elem() 107 static int inode_storage_delete(struct inode *inode, struct bpf_map *map) in inode_storage_delete() 120 static long bpf_fd_inode_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_delete_elem() 130 BPF_CALL_5(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, in BPF_CALL_5() argument 166 struct bpf_map *, map, struct inode *, inode) in BPF_CALL_2() argument 178 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() 184 static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr) in inode_storage_map_alloc() 189 static void inode_storage_map_free(struct bpf_map *ma [all...] |
H A D | bpf_task_storage.c | 54 task_storage_lookup(struct task_struct *task, struct bpf_map *map, in task_storage_lookup() 88 static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_lookup_elem() 121 static long bpf_pid_task_storage_update_elem(struct bpf_map *map, void *key, in bpf_pid_task_storage_update_elem() 160 static int task_storage_delete(struct task_struct *task, struct bpf_map *map, in task_storage_delete() 177 static long bpf_pid_task_storage_delete_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_delete_elem() 208 static void *__bpf_task_storage_get(struct bpf_map *map, in __bpf_task_storage_get() 231 BPF_CALL_5(bpf_task_storage_get_recur, struct bpf_map *, map, struct task_struct *, in BPF_CALL_5() argument 250 BPF_CALL_5(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, in BPF_CALL_5() argument 266 BPF_CALL_2(bpf_task_storage_delete_recur, struct bpf_map *, map, struct task_struct *, in BPF_CALL_2() argument 287 BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, ma argument [all...] |
H A D | bpf_cgrp_storage.c | 63 cgroup_storage_lookup(struct cgroup *cgroup, struct bpf_map *map, bool cacheit_lockit) in cgroup_storage_lookup() 77 static void *bpf_cgrp_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_cgrp_storage_lookup_elem() 95 static long bpf_cgrp_storage_update_elem(struct bpf_map *map, void *key, in bpf_cgrp_storage_update_elem() 115 static int cgroup_storage_delete(struct cgroup *cgroup, struct bpf_map *map) in cgroup_storage_delete() 127 static long bpf_cgrp_storage_delete_elem(struct bpf_map *map, void *key) in bpf_cgrp_storage_delete_elem() 144 static int notsupp_get_next_key(struct bpf_map *map, void *key, void *next_key) in notsupp_get_next_key() 149 static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) in cgroup_storage_map_alloc() 154 static void cgroup_storage_map_free(struct bpf_map *map) in cgroup_storage_map_free() 160 BPF_CALL_5(bpf_cgrp_storage_get, struct bpf_map *, map, struct cgroup *, cgroup, in BPF_CALL_5() argument 191 BPF_CALL_2(bpf_cgrp_storage_delete, struct bpf_map *, ma argument [all...] |
H A 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() 81 BTF_ID_LIST_GLOBAL_SINGLE(btf_bpf_map_id, struct, bpf_map) 91 .target = "bpf_map", 105 struct bpf_map *map; in bpf_iter_attach_map() 165 struct bpf_map *ma [all...] |
H A D | arena.c | 46 struct bpf_map map; 65 static long arena_map_peek_elem(struct bpf_map *map, void *value) in arena_map_peek_elem() 70 static long arena_map_push_elem(struct bpf_map *map, void *value, u64 flags) in arena_map_push_elem() 75 static long arena_map_pop_elem(struct bpf_map *map, void *value) in arena_map_pop_elem() 80 static long arena_map_delete_elem(struct bpf_map *map, void *value) in arena_map_delete_elem() 85 static int arena_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in arena_map_get_next_key() 95 static struct bpf_map *arena_map_alloc(union bpf_attr *attr) in arena_map_alloc() 174 static void arena_map_free(struct bpf_map *map) in arena_map_free() 180 * mmap() holds vm_file which holds bpf_map refcnt. in arena_map_free() 200 static void *arena_map_lookup_elem(struct bpf_map *ma [all...] |
H A D | local_storage.c | 22 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 long 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() 330 static void cgroup_storage_map_free(struct bpf_map *_ma [all...] |
H A D | hashtab.c | 89 struct bpf_map map; 199 static void *fd_htab_map_get_ptr(const struct bpf_map *map, struct htab_elem *l) in fd_htab_map_get_ptr() 467 static struct bpf_map *htab_map_alloc(union bpf_attr *attr) in htab_map_alloc() 657 static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) in __htab_map_lookup_elem() 678 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem() 699 static int htab_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in htab_map_gen_lookup() 705 (void *(*)(struct bpf_map *map, void *key))NULL)); in htab_map_gen_lookup() 714 static __always_inline void *__htab_lru_map_lookup_elem(struct bpf_map *map, in __htab_lru_map_lookup_elem() 728 static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key) in htab_lru_map_lookup_elem() 733 static void *htab_lru_map_lookup_elem_sys(struct bpf_map *ma [all...] |
H A D | bpf_struct_ops.c | 25 struct bpf_map map; 60 struct bpf_map __rcu *map; 472 static int bpf_struct_ops_map_get_next_key(struct bpf_map *map, void *key, in bpf_struct_ops_map_get_next_key() 482 int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_sys_lookup_elem() 519 static void *bpf_struct_ops_map_lookup_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_lookup_elem() 676 static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_update_elem() 907 static long bpf_struct_ops_map_delete_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_delete_elem() 935 static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_seq_show_elem() 957 static void __bpf_struct_ops_map_free(struct bpf_map *map) in __bpf_struct_ops_map_free() 972 static void bpf_struct_ops_map_free(struct bpf_map *ma [all...] |
/linux/include/linux/ |
H A D | bpf.h | 40 struct bpf_map; 85 struct bpf_map *(*map_alloc)(union bpf_attr *attr); 86 void (*map_release)(struct bpf_map *map, struct file *map_file); 87 void (*map_free)(struct bpf_map *map); 88 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); 89 void (*map_release_uref)(struct bpf_map *map); 90 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key); 91 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr, 93 int (*map_lookup_and_delete_elem)(struct bpf_map *map, void *key, 95 int (*map_lookup_and_delete_batch)(struct bpf_map *ma 290 struct bpf_map { global() struct 291 opsbpf_map global() argument 292 inner_map_metabpf_map global() argument 296 map_typebpf_map global() argument 297 key_sizebpf_map global() argument 298 value_sizebpf_map global() argument 299 max_entriesbpf_map global() argument 323 ownerbpf_map global() argument 324 bypass_spec_v1bpf_map global() argument 325 frozenbpf_map global() argument 326 free_after_mult_rcu_gpbpf_map global() argument 327 free_after_rcu_gpbpf_map global() argument 328 sleepable_refcntbpf_map global() argument 329 elem_countbpf_map global() argument 330 cookiebpf_map global() argument [all...] |
H A D | bpf_local_storage.h | 40 * particular object, the "bpf_map" pointer is actually used 44 * e.g. sk->sk_bpf_storage is the mini-map with the "bpf_map" pointer 48 struct bpf_map map; 133 struct bpf_map * 171 void bpf_local_storage_map_free(struct bpf_map *map, 175 int bpf_local_storage_map_check_btf(const struct bpf_map *map, 206 u64 bpf_local_storage_map_mem_usage(const struct bpf_map *map);
|
/linux/net/xdp/ |
H A D | xskmap.c | 64 static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) in xsk_map_alloc() 88 static u64 xsk_map_mem_usage(const struct bpf_map *map) in xsk_map_mem_usage() 96 static void xsk_map_free(struct bpf_map *map) in xsk_map_free() 104 static int xsk_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in xsk_map_get_next_key() 121 static int xsk_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in xsk_map_gen_lookup() 141 static void *__xsk_map_lookup_elem(struct bpf_map *map, u32 key) in __xsk_map_lookup_elem() 151 static void *xsk_map_lookup_elem(struct bpf_map *map, void *key) in xsk_map_lookup_elem() 156 static void *xsk_map_lookup_elem_sys_only(struct bpf_map *map, void *key) in xsk_map_lookup_elem_sys_only() 161 static long xsk_map_update_elem(struct bpf_map *map, void *key, void *value, in xsk_map_update_elem() 222 static long xsk_map_delete_elem(struct bpf_map *ma [all...] |
/linux/net/core/ |
H A D | sock_map.c | 18 struct bpf_map map; 34 static int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, 37 static struct sk_psock_progs *sock_map_progs(struct bpf_map *map); 39 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() 89 struct bpf_map *map; in sock_map_prog_detach() 133 struct bpf_map *map, void *link_raw) in sock_map_add_link() 151 struct bpf_map *map = link->map; in sock_map_del_link() 217 static int sock_map_link(struct bpf_map *map, struct sock *sk) in sock_map_link() 339 static void sock_map_free(struct bpf_map *ma 623 BPF_CALL_4(bpf_sock_map_update,struct bpf_sock_ops_kern *,sops,struct bpf_map *,map,void *,key,u64,flags) BPF_CALL_4() argument 646 BPF_CALL_4(bpf_sk_redirect_map,struct sk_buff *,skb,struct bpf_map *,map,u32,key,u64,flags) BPF_CALL_4() argument 674 BPF_CALL_4(bpf_msg_redirect_map,struct sk_msg *,msg,struct bpf_map *,map,u32,key,u64,flags) BPF_CALL_4() argument 1230 BPF_CALL_4(bpf_sock_hash_update,struct bpf_sock_ops_kern *,sops,struct bpf_map *,map,void *,key,u64,flags) BPF_CALL_4() argument 1252 BPF_CALL_4(bpf_sk_redirect_hash,struct sk_buff *,skb,struct bpf_map *,map,void *,key,u64,flags) BPF_CALL_4() argument 1280 BPF_CALL_4(bpf_msg_redirect_hash,struct sk_msg *,msg,struct bpf_map *,map,void *,key,u64,flags) BPF_CALL_4() argument [all...] |
H A D | bpf_sk_storage.c | 21 bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit) in bpf_sk_storage_lookup() 35 static int bpf_sk_storage_del(struct sock *sk, struct bpf_map *map) in bpf_sk_storage_del() 65 static void bpf_sk_storage_map_free(struct bpf_map *map) in bpf_sk_storage_map_free() 70 static struct bpf_map *bpf_sk_storage_map_alloc(union bpf_attr *attr) in bpf_sk_storage_map_alloc() 75 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() 81 static void *bpf_fd_sk_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_lookup_elem() 98 static long bpf_fd_sk_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_sk_storage_update_elem() 118 static long bpf_fd_sk_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_delete_elem() 174 struct bpf_map *map; in bpf_sk_storage_clone() 227 BPF_CALL_5(bpf_sk_storage_get, struct bpf_map *, ma argument 261 BPF_CALL_2(bpf_sk_storage_delete,struct bpf_map *,map,struct sock *,sk) BPF_CALL_2() argument 382 BPF_CALL_5(bpf_sk_storage_get_tracing,struct bpf_map *,map,struct sock *,sk,void *,value,u64,flags,gfp_t,gfp_flags) BPF_CALL_5() argument 393 BPF_CALL_2(bpf_sk_storage_delete_tracing,struct bpf_map *,map,struct sock *,sk) BPF_CALL_2() argument [all...] |
/linux/tools/perf/util/ |
H A D | bpf_map.h | 6 struct bpf_map; 10 int bpf_map__fprintf(struct bpf_map *map, FILE *fp); 16 static inline int bpf_map__fprintf(struct bpf_map *map __maybe_unused, FILE *fp __maybe_unused) in bpf_map__fprintf()
|
/linux/kernel/bpf/preload/iterators/ |
H A D | iterators.bpf.c | 15 struct bpf_map { struct 23 struct bpf_map *map; argument 76 __s64 bpf_map_sum_elem_count(struct bpf_map *map) __ksym; 78 SEC("iter/bpf_map") 83 struct bpf_map *map = ctx->map; in dump_bpf_map()
|