/kernel/linux/linux-6.6/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() 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 [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()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
H A D | map_ptr_kern.c | 33 struct bpf_map { struct 42 static inline int check_bpf_map_fields(struct bpf_map *map, __u32 key_size, in check_bpf_map_fields() 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 *direc [all...] |
/kernel/linux/linux-5.10/include/linux/ |
H A D | bpf.h | 30 struct bpf_map; 58 struct bpf_map *(*map_alloc)(union bpf_attr *attr); 59 void (*map_release)(struct bpf_map *map, struct file *map_file); 60 void (*map_free)(struct bpf_map *map); 61 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); 62 void (*map_release_uref)(struct bpf_map *map); 63 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key); 64 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr, 66 int (*map_lookup_and_delete_batch)(struct bpf_map *map, 69 int (*map_update_batch)(struct bpf_map *ma 146 struct bpf_map { global() struct [all...] |
/kernel/linux/linux-5.10/tools/lib/bpf/ |
H A D | libbpf.h | 268 struct bpf_map; 270 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(struct bpf_map *map); 407 * The 'struct bpf_map' in include/linux/bpf.h is internal to the kernel, 410 LIBBPF_API struct bpf_map * 417 * Get bpf_map through the offset of corresponding struct bpf_map_def 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 *ma [all...] |
/kernel/linux/linux-6.6/tools/lib/bpf/ |
H A D | libbpf.h | 803 struct bpf_map; 805 LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(const struct bpf_map *map); 806 LIBBPF_API int bpf_link__update_map(struct bpf_link *link, const struct bpf_map *map); 889 LIBBPF_API struct bpf_map * 895 LIBBPF_API struct bpf_map * 896 bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *map); 904 LIBBPF_API struct bpf_map * 905 bpf_object__prev_map(const struct bpf_object *obj, const struct bpf_map *map); 926 LIBBPF_API int bpf_map__set_autocreate(struct bpf_map *map, bool autocreate); 927 LIBBPF_API bool bpf_map__autocreate(const struct bpf_map *ma [all...] |
/kernel/linux/linux-6.6/include/linux/ |
H A D | bpf.h | 38 struct bpf_map; 78 struct bpf_map *(*map_alloc)(union bpf_attr *attr); 79 void (*map_release)(struct bpf_map *map, struct file *map_file); 80 void (*map_free)(struct bpf_map *map); 81 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); 82 void (*map_release_uref)(struct bpf_map *map); 83 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key); 84 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr, 86 int (*map_lookup_and_delete_elem)(struct bpf_map *map, void *key, 88 int (*map_lookup_and_delete_batch)(struct bpf_map *ma 247 struct bpf_map { global() struct [all...] |
/kernel/linux/linux-6.6/kernel/bpf/ |
H A 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() 64 static struct bpf_map *queue_stack_map_alloc(union bpf_attr *attr) in queue_stack_map_alloc() 87 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free() 94 static long __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get() 128 static long __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() 165 static long queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() 171 static long stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() 177 static long queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() 183 static long stack_map_pop_elem(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() 83 static struct bpf_map *bloom_map_alloc(union bpf_attr *attr) in bloom_map_alloc() 150 static void bloom_map_free(struct bpf_map *map) in bloom_map_free() 158 static void *bloom_map_lookup_elem(struct bpf_map *map, void *key) in bloom_map_lookup_elem() 164 static long bloom_map_update_elem(struct bpf_map *ma [all...] |
H A D | arraymap.c | 80 static struct bpf_map *array_map_alloc(union bpf_attr *attr) in array_map_alloc() 163 static void *array_map_lookup_elem(struct bpf_map *map, void *key) in array_map_lookup_elem() 174 static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, in array_map_direct_value_addr() 188 static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, in array_map_direct_value_meta() 205 static int array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) in array_map_gen_lookup() 238 static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) in percpu_array_map_lookup_elem() 249 static void *percpu_array_map_lookup_percpu_elem(struct bpf_map *map, void *key, u32 cpu) in percpu_array_map_lookup_percpu_elem() 263 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_array_copy() 291 static int array_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in array_map_get_next_key() 310 static long array_map_update_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() 90 void bpf_map_meta_free(struct bpf_map *map_meta) in bpf_map_meta_free() 97 bool bpf_map_meta_equal(const struct bpf_map *meta0, in bpf_map_meta_equal() 98 const struct bpf_map *meta1) in bpf_map_meta_equal() 108 void *bpf_map_fd_get_ptr(struct bpf_map *map, in bpf_map_fd_get_ptr() 112 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_fd_get_ptr() 130 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer) in bpf_map_fd_put_ptr() 132 struct bpf_map *inner_map = ptr; in bpf_map_fd_put_ptr() 145 return ((struct bpf_map *)pt in bpf_map_fd_sys_lookup_elem() [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_task_storage.c | 57 task_storage_lookup(struct task_struct *task, struct bpf_map *map, in task_storage_lookup() 90 static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_lookup_elem() 123 static long bpf_pid_task_storage_update_elem(struct bpf_map *map, void *key, in bpf_pid_task_storage_update_elem() 159 static int task_storage_delete(struct task_struct *task, struct bpf_map *map, in task_storage_delete() 176 static long bpf_pid_task_storage_delete_elem(struct bpf_map *map, void *key) in bpf_pid_task_storage_delete_elem() 207 static void *__bpf_task_storage_get(struct bpf_map *map, in __bpf_task_storage_get() 230 BPF_CALL_5(bpf_task_storage_get_recur, struct bpf_map *, map, struct task_struct *, in BPF_CALL_5() 249 BPF_CALL_5(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, in BPF_CALL_5() 265 BPF_CALL_2(bpf_task_storage_delete_recur, struct bpf_map *, map, struct task_struct *, in BPF_CALL_2() 286 BPF_CALL_2(bpf_task_storage_delete, 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 | 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) 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 | bpf_cgrp_storage.c | 64 cgroup_storage_lookup(struct cgroup *cgroup, struct bpf_map *map, bool cacheit_lockit) in cgroup_storage_lookup() 78 static void *bpf_cgrp_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_cgrp_storage_lookup_elem() 96 static long bpf_cgrp_storage_update_elem(struct bpf_map *map, void *key, in bpf_cgrp_storage_update_elem() 116 static int cgroup_storage_delete(struct cgroup *cgroup, struct bpf_map *map) in cgroup_storage_delete() 128 static long bpf_cgrp_storage_delete_elem(struct bpf_map *map, void *key) in bpf_cgrp_storage_delete_elem() 145 static int notsupp_get_next_key(struct bpf_map *map, void *key, void *next_key) in notsupp_get_next_key() 150 static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) in cgroup_storage_map_alloc() 155 static void cgroup_storage_map_free(struct bpf_map *map) in cgroup_storage_map_free() 161 BPF_CALL_5(bpf_cgrp_storage_get, struct bpf_map *, map, struct cgroup *, cgroup, in BPF_CALL_5() 191 BPF_CALL_2(bpf_cgrp_storage_delete, struct bpf_map *, ma [all...] |
H A D | bpf_inode_storage.c | 37 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() 91 static long bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key, in bpf_fd_inode_storage_update_elem() 111 static int inode_storage_delete(struct inode *inode, struct bpf_map *map) in inode_storage_delete() 124 static long bpf_fd_inode_storage_delete_elem(struct bpf_map *map, void *key) in bpf_fd_inode_storage_delete_elem() 138 BPF_CALL_5(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode, in BPF_CALL_5() 174 struct bpf_map *, map, struct inode *, inode) in BPF_CALL_2() 186 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() 192 static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr) in inode_storage_map_alloc() 197 static void inode_storage_map_free(struct bpf_map *ma [all...] |
/kernel/linux/linux-5.10/kernel/bpf/ |
H A D | arraymap.c | 81 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 *ma [all...] |
H A D | map_in_map.c | 9 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() 103 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer) in bpf_map_fd_put_ptr() 113 return ((struct bpf_map *)ptr)->id; in bpf_map_fd_sys_lookup_elem()
|
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 | 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() 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() 141 static int __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() 178 static int queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() 184 static int stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() 190 static int queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() 196 static int stack_map_pop_elem(struct bpf_map *ma [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) 71 bpf_map_put((struct bpf_map *)v); in bpf_map_seq_stop() 82 BTF_ID(struct, bpf_map) 92 .target = "bpf_map", 106 struct bpf_map *map; in bpf_iter_attach_map() 166 struct bpf_map *ma [all...] |
H A 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() 205 struct bpf_map *, map, struct inode *, inode) in BPF_CALL_2() 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 *ma [all...] |
/kernel/linux/linux-5.10/tools/perf/include/bpf/ |
H A D | bpf.h | 11 struct bpf_map { struct 21 #define bpf_map(name, _type, type_key, type_val, _max_entries) \ macro 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 *)BPF_FUNC_map_update_elem; 46 static void *(*bpf_map_lookup_elem)(struct bpf_map *map, void *key) = (void *)BPF_FUNC_map_lookup_elem; 68 static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) = (void *)BPF_FUNC_perf_event_output;
|
/kernel/linux/linux-6.6/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...] |