/kernel/linux/linux-6.6/kernel/bpf/ |
H A D | map_in_map.c | 12 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_meta_alloc() local 18 inner_map = __bpf_map_get(f); in bpf_map_meta_alloc() 19 if (IS_ERR(inner_map)) in bpf_map_meta_alloc() 20 return inner_map; in bpf_map_meta_alloc() 23 if (inner_map->inner_map_meta) { in bpf_map_meta_alloc() 28 if (!inner_map->ops->map_meta_equal) { in bpf_map_meta_alloc() 35 if (inner_map->ops == &array_map_ops) in bpf_map_meta_alloc() 44 inner_map_meta->map_type = inner_map->map_type; in bpf_map_meta_alloc() 45 inner_map_meta->key_size = inner_map->key_size; in bpf_map_meta_alloc() 46 inner_map_meta->value_size = inner_map in bpf_map_meta_alloc() 112 struct bpf_map *inner_map, *inner_map_meta; bpf_map_fd_get_ptr() local 132 struct bpf_map *inner_map = ptr; bpf_map_fd_put_ptr() local [all...] |
H A D | arraymap.c | 1133 * Thus, prog_array_map cannot be used as an inner_map 1325 struct bpf_map **inner_map = array_map_lookup_elem(map, key); in array_of_map_lookup_elem() local 1327 if (!inner_map) in array_of_map_lookup_elem() 1330 return READ_ONCE(*inner_map); in array_of_map_lookup_elem()
|
/kernel/linux/linux-5.10/kernel/bpf/ |
H A D | map_in_map.c | 11 struct bpf_map *inner_map, *inner_map_meta; in bpf_map_meta_alloc() local 16 inner_map = __bpf_map_get(f); in bpf_map_meta_alloc() 17 if (IS_ERR(inner_map)) in bpf_map_meta_alloc() 18 return inner_map; in bpf_map_meta_alloc() 21 if (inner_map->inner_map_meta) { in bpf_map_meta_alloc() 26 if (!inner_map->ops->map_meta_equal) { in bpf_map_meta_alloc() 31 if (map_value_has_spin_lock(inner_map)) { in bpf_map_meta_alloc() 38 if (inner_map->ops == &array_map_ops) in bpf_map_meta_alloc() 47 inner_map_meta->map_type = inner_map->map_type; in bpf_map_meta_alloc() 48 inner_map_meta->key_size = inner_map in bpf_map_meta_alloc() 85 struct bpf_map *inner_map, *inner_map_meta; bpf_map_fd_get_ptr() local [all...] |
H A D | arraymap.c | 1065 * Thus, prog_array_map cannot be used as an inner_map 1260 struct bpf_map **inner_map = array_map_lookup_elem(map, key); in array_of_map_lookup_elem() local 1262 if (!inner_map) in array_of_map_lookup_elem() 1265 return READ_ONCE(*inner_map); in array_of_map_lookup_elem()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
H A D | test_btf_map_in_map.c | 6 struct inner_map { struct 30 * due to incompatibility with inner_map definition */ 36 /* (void *) cast is necessary because we didn't use `struct inner_map` 85 /* Here everything works flawlessly due to reuse of struct inner_map 86 * and compiler will complain at the attempt to use non-inner_map 89 __array(values, struct inner_map); 126 struct inner_map *inner_map; in handle__sys_enter() local 129 inner_map = bpf_map_lookup_elem(&outer_arr, &key); in handle__sys_enter() 130 if (!inner_map) in handle__sys_enter() [all...] |
H A D | map_ptr_kern.c | 343 struct inner_map { struct 348 } inner_map SEC(".maps"); 362 .values = { (void *)&inner_map, 0, 0, 0, 0, 0, 0, 0, 0 }, 380 __array(values, struct inner_map); 383 [2] = &inner_map,
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/ |
H A D | test_btf_map_in_map.c | 6 struct inner_map { struct 30 * due to incompatibility with inner_map definition */ 36 /* (void *) cast is necessary because we didn't use `struct inner_map` 85 /* Here everything works flawlessly due to reuse of struct inner_map 86 * and compiler will complain at the attempt to use non-inner_map 89 __array(values, struct inner_map); 126 struct inner_map *inner_map; in handle__sys_enter() local 129 inner_map = bpf_map_lookup_elem(&outer_arr, &key); in handle__sys_enter() 130 if (!inner_map) in handle__sys_enter() [all...] |
H A D | lsm.c | 56 struct inner_map { struct 61 } inner_map SEC(".maps"); 68 __array(values, struct inner_map); 70 .values = { [0] = &inner_map }, 77 __array(values, struct inner_map); 79 .values = { [0] = &inner_map }, 113 struct inner_map *inner_map; in BPF_PROG() local 142 inner_map = bpf_map_lookup_elem(&outer_arr, &key); in BPF_PROG() 143 if (inner_map) { in BPF_PROG() [all...] |
H A D | timer_mim.c | 15 struct inner_map { struct 30 __array(values, struct inner_map); 68 struct bpf_map *inner_map; in BPF_PROG() local 73 inner_map = bpf_map_lookup_elem(&outer_arr, &array_key); in BPF_PROG() 74 if (!inner_map) in BPF_PROG() 77 bpf_map_update_elem(inner_map, &hash_key, &init, 0); in BPF_PROG() 78 val = bpf_map_lookup_elem(inner_map, &hash_key); in BPF_PROG() 82 bpf_timer_init(&val->timer, inner_map, CLOCK_MONOTONIC); in BPF_PROG()
|
H A D | timer_mim_reject.c | 15 struct inner_map { struct 31 __array(values, struct inner_map); 50 struct bpf_map *inner_map, *inner_map2; in BPF_PROG() local 56 inner_map = bpf_map_lookup_elem(&outer_arr, &array_key); in BPF_PROG() 57 if (!inner_map) in BPF_PROG() 63 bpf_map_update_elem(inner_map, &hash_key, &init, 0); in BPF_PROG() 64 val = bpf_map_lookup_elem(inner_map, &hash_key); in BPF_PROG()
|
H A D | bloom_filter_map.c | 56 int inner_map(void *ctx) in inner_map() function 58 struct bpf_map *inner_map; in inner_map() local 62 inner_map = bpf_map_lookup_elem(&outer_map, &key); in inner_map() 63 if (!inner_map) { in inner_map() 68 data.map = inner_map; in inner_map()
|
H A D | local_storage_bench.c | 53 void *map, *inner_map; in do_lookup() local 61 inner_map = bpf_map_lookup_elem(map, &elem); in do_lookup() 62 if (!inner_map) in do_lookup() 67 bpf_map_lookup_elem(inner_map, &idx); in do_lookup() 69 bpf_task_storage_get(inner_map, lctx->task, &idx, in do_lookup()
|
H A D | jeq_infer_not_null_fail.c | 21 struct bpf_map *inner_map = map->inner_map_meta; in jeq_infer_not_null_ptr_to_btfid() local 31 * once it figures out val==inner_map. in jeq_infer_not_null_ptr_to_btfid() 34 "r9 = %[inner_map];\n" in jeq_infer_not_null_ptr_to_btfid() 38 : [inner_map] "r"(inner_map), [val] "r"(val) in jeq_infer_not_null_ptr_to_btfid()
|
H A D | map_ptr_kern.c | 344 struct inner_map { struct 349 } inner_map SEC(".maps"); 363 .values = { (void *)&inner_map, 0, 0, 0, 0, 0, 0, 0, 0 }, 370 struct bpf_array *inner_map; in check_array_of_maps() local 374 inner_map = bpf_map_lookup_elem(array_of_maps, &key); in check_array_of_maps() 375 VERIFY(inner_map != NULL); in check_array_of_maps() 376 VERIFY(inner_map->map.max_entries == INNER_MAX_ENTRIES); in check_array_of_maps() 386 __array(values, struct inner_map); 389 [2] = &inner_map, 397 struct bpf_htab *inner_map; in check_hash_of_maps() local [all...] |
H A D | inner_array_lookup.c | 6 struct inner_map { struct 17 __array(values, struct inner_map);
|
H A D | linked_list.h | 36 struct array_map inner_map SEC(".maps"); 46 [0] = &inner_map,
|
H A D | linked_list_fail.c | 66 CHECK(inner_map, pop_front, &iv->head); 67 CHECK(inner_map, pop_back, &iv->head); 89 CHECK(inner_map, push_front, &iv->head, &f->node2); 90 CHECK(inner_map, push_back, &iv->head, &f->node2);
|
/kernel/linux/linux-5.10/samples/bpf/ |
H A D | test_map_in_map_kern.c | 76 static __always_inline int do_reg_lookup(void *inner_map, u32 port) in do_reg_lookup() argument 80 result = bpf_map_lookup_elem(inner_map, &port); in do_reg_lookup() 84 static __always_inline int do_inline_array_lookup(void *inner_map, u32 port) in do_inline_array_lookup() argument 88 if (inner_map != &port_a) in do_inline_array_lookup() 95 static __always_inline int do_inline_hash_lookup(void *inner_map, u32 port) in do_inline_hash_lookup() argument 99 if (inner_map != &port_h) in do_inline_hash_lookup() 113 void *outer_map, *inner_map; in trace_sys_connect() local 154 inner_map = bpf_map_lookup_elem(outer_map, &port_key); in trace_sys_connect() 155 if (!inner_map) { in trace_sys_connect() 161 ret = do_reg_lookup(inner_map, port_ke in trace_sys_connect() [all...] |
/kernel/linux/linux-6.6/samples/bpf/ |
H A D | test_map_in_map.bpf.c | 76 static __always_inline int do_reg_lookup(void *inner_map, u32 port) in do_reg_lookup() argument 80 result = bpf_map_lookup_elem(inner_map, &port); in do_reg_lookup() 84 static __always_inline int do_inline_array_lookup(void *inner_map, u32 port) in do_inline_array_lookup() argument 88 if (inner_map != &port_a) in do_inline_array_lookup() 95 static __always_inline int do_inline_hash_lookup(void *inner_map, u32 port) in do_inline_hash_lookup() argument 99 if (inner_map != &port_h) in do_inline_hash_lookup() 112 void *outer_map, *inner_map; in BPF_KSYSCALL() local 150 inner_map = bpf_map_lookup_elem(outer_map, &port_key); in BPF_KSYSCALL() 151 if (!inner_map) { in BPF_KSYSCALL() 157 ret = do_reg_lookup(inner_map, port_ke in BPF_KSYSCALL() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/benchs/ |
H A D | bench_local_storage.c | 117 struct bpf_map *inner_map; in __setup() local 127 inner_map = bpf_map__inner_map(ctx.array_of_maps); in __setup() 128 create_opts.btf_key_type_id = bpf_map__btf_key_type_id(inner_map); in __setup() 129 create_opts.btf_value_type_id = bpf_map__btf_value_type_id(inner_map); in __setup()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
H A D | linked_list.c | 29 TEST(inner_map, 0) 56 TEST(inner_map, push_front) 57 TEST(inner_map, push_back) 58 TEST(inner_map, pop_front) 59 TEST(inner_map, pop_back) 178 clear_fields(skel->maps.inner_map); in test_linked_list_success() 200 clear_fields(skel->maps.inner_map); in test_linked_list_success() 222 clear_fields(skel->maps.inner_map); in test_linked_list_success()
|
H A D | sockmap_listen.c | 728 struct bpf_map *inner_map, int family, in test_skb_redir_to_connected() 734 int sock_map = bpf_map__fd(inner_map); in test_skb_redir_to_connected() 753 struct bpf_map *inner_map, int family, in test_msg_redir_to_connected() 758 int sock_map = bpf_map__fd(inner_map); in test_msg_redir_to_connected() 830 struct bpf_map *inner_map, int family, in test_skb_redir_to_listening() 836 int sock_map = bpf_map__fd(inner_map); in test_skb_redir_to_listening() 855 struct bpf_map *inner_map, int family, in test_msg_redir_to_listening() 860 int sock_map = bpf_map__fd(inner_map); in test_msg_redir_to_listening() 919 struct bpf_map *inner_map, int family, in test_skb_redir_partial() 925 int sock_map = bpf_map__fd(inner_map); in test_skb_redir_partial() 727 test_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_skb_redir_to_connected() argument 752 test_msg_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_msg_redir_to_connected() argument 829 test_skb_redir_to_listening(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_skb_redir_to_listening() argument 854 test_msg_redir_to_listening(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_msg_redir_to_listening() argument 918 test_skb_redir_partial(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_skb_redir_partial() argument 1393 unix_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int sotype) unix_skb_redir_to_connected() argument 1543 vsock_unix_skb_redir_connectible(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int sotype) vsock_unix_skb_redir_connectible() argument 1713 udp_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family) udp_skb_redir_to_connected() argument 1801 inet_unix_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family) inet_unix_skb_redir_to_connected() argument 1882 unix_inet_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family) unix_inet_skb_redir_to_connected() argument [all...] |
H A D | bloom_filter_map.c | 123 link = bpf_program__attach(skel->progs.inner_map); in test_inner_map()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
H A D | sockmap_listen.c | 1014 struct bpf_map *inner_map, int family, in test_skb_redir_to_connected() 1020 int sock_map = bpf_map__fd(inner_map); in test_skb_redir_to_connected() 1039 struct bpf_map *inner_map, int family, in test_msg_redir_to_connected() 1044 int sock_map = bpf_map__fd(inner_map); in test_msg_redir_to_connected() 1125 struct bpf_map *inner_map, int family, in test_skb_redir_to_listening() 1131 int sock_map = bpf_map__fd(inner_map); in test_skb_redir_to_listening() 1150 struct bpf_map *inner_map, int family, in test_msg_redir_to_listening() 1155 int sock_map = bpf_map__fd(inner_map); in test_msg_redir_to_listening() 1013 test_skb_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_skb_redir_to_connected() argument 1038 test_msg_redir_to_connected(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_msg_redir_to_connected() argument 1124 test_skb_redir_to_listening(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_skb_redir_to_listening() argument 1149 test_msg_redir_to_listening(struct test_sockmap_listen *skel, struct bpf_map *inner_map, int family, int sotype) test_msg_redir_to_listening() argument
|
/kernel/linux/linux-6.6/tools/lib/bpf/ |
H A D | libbpf.c | 527 struct bpf_map *inner_map; member 2595 map->inner_map = calloc(1, sizeof(*map->inner_map)); in bpf_object__init_user_btf_map() 2596 if (!map->inner_map) in bpf_object__init_user_btf_map() 2598 map->inner_map->fd = -1; in bpf_object__init_user_btf_map() 2599 map->inner_map->sec_idx = sec_idx; in bpf_object__init_user_btf_map() 2600 map->inner_map->name = malloc(strlen(map_name) + sizeof(".inner") + 1); in bpf_object__init_user_btf_map() 2601 if (!map->inner_map->name) in bpf_object__init_user_btf_map() 2603 sprintf(map->inner_map->name, "%s.inner", map_name); in bpf_object__init_user_btf_map() 2605 fill_map_from_def(map->inner_map, in bpf_object__init_user_btf_map() [all...] |