Lines Matching refs:map

21 bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)  in bpf_sk_storage_lookup()  argument
31 smap = (struct bpf_local_storage_map *)map; in bpf_sk_storage_lookup()
35 static int bpf_sk_storage_del(struct sock *sk, struct bpf_map *map) in bpf_sk_storage_del() argument
39 sdata = bpf_sk_storage_lookup(sk, map, false); in bpf_sk_storage_del()
65 static void bpf_sk_storage_map_free(struct bpf_map *map) in bpf_sk_storage_map_free() argument
67 bpf_local_storage_map_free(map, &sk_cache, NULL); in bpf_sk_storage_map_free()
75 static int notsupp_get_next_key(struct bpf_map *map, void *key, in notsupp_get_next_key() argument
81 static void *bpf_fd_sk_storage_lookup_elem(struct bpf_map *map, void *key) in bpf_fd_sk_storage_lookup_elem() argument
90 sdata = bpf_sk_storage_lookup(sock->sk, map, true); 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() argument
109 sock->sk, (struct bpf_local_storage_map *)map, value, 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() argument
126 err = bpf_sk_storage_del(sock->sk, map); in bpf_fd_sk_storage_delete_elem()
145 if (btf_record_has_field(smap->map.record, BPF_SPIN_LOCK)) in bpf_sk_storage_clone_elem()
146 copy_map_value_locked(&smap->map, SDATA(copy_selem)->data, in bpf_sk_storage_clone_elem()
149 copy_map_value(&smap->map, SDATA(copy_selem)->data, in bpf_sk_storage_clone_elem()
174 struct bpf_map *map; in bpf_sk_storage_clone() local
177 if (!(smap->map.map_flags & BPF_F_CLONE)) in bpf_sk_storage_clone()
185 map = bpf_map_inc_not_zero(&smap->map); in bpf_sk_storage_clone()
186 if (IS_ERR(map)) in bpf_sk_storage_clone()
192 bpf_map_put(map); in bpf_sk_storage_clone()
205 bpf_map_put(map); in bpf_sk_storage_clone()
212 bpf_map_put(map); in bpf_sk_storage_clone()
227 BPF_CALL_5(bpf_sk_storage_get, struct bpf_map *, map, struct sock *, sk, in BPF_CALL_5() argument
236 sdata = bpf_sk_storage_lookup(sk, map, true); in BPF_CALL_5()
248 sk, (struct bpf_local_storage_map *)map, value, in BPF_CALL_5()
261 BPF_CALL_2(bpf_sk_storage_delete, struct bpf_map *, map, struct sock *, sk) in BPF_CALL_2() argument
270 err = bpf_sk_storage_del(sk, map); in BPF_CALL_2()
382 BPF_CALL_5(bpf_sk_storage_get_tracing, struct bpf_map *, map, struct sock *, sk, in BPF_CALL_5() argument
389 return (unsigned long)____bpf_sk_storage_get(map, sk, value, flags, in BPF_CALL_5()
393 BPF_CALL_2(bpf_sk_storage_delete_tracing, struct bpf_map *, map, in BPF_CALL_2() argument
400 return ____bpf_sk_storage_delete(map, sk); in BPF_CALL_2()
465 const struct bpf_map *map) in diag_check_dup() argument
470 if (diag->maps[i] == map) in diag_check_dup()
505 struct bpf_map *map = bpf_map_get(map_fd); in bpf_sk_storage_diag_alloc() local
507 if (IS_ERR(map)) { in bpf_sk_storage_diag_alloc()
508 err = PTR_ERR(map); in bpf_sk_storage_diag_alloc()
511 if (map->map_type != BPF_MAP_TYPE_SK_STORAGE) { in bpf_sk_storage_diag_alloc()
512 bpf_map_put(map); in bpf_sk_storage_diag_alloc()
516 if (diag_check_dup(diag, map)) { in bpf_sk_storage_diag_alloc()
517 bpf_map_put(map); in bpf_sk_storage_diag_alloc()
521 diag->maps[diag->nr_maps++] = map; in bpf_sk_storage_diag_alloc()
545 if (nla_put_u32(skb, SK_DIAG_BPF_STORAGE_MAP_ID, smap->map.id)) in diag_get()
549 smap->map.value_size, in diag_get()
554 if (btf_record_has_field(smap->map.record, BPF_SPIN_LOCK)) in diag_get()
555 copy_map_value_locked(&smap->map, nla_data(nla_value), in diag_get()
558 copy_map_value(&smap->map, nla_data(nla_value), sdata->data); in diag_get()
597 diag_size += nla_value_size(smap->map.value_size); in bpf_sk_storage_diag_put_all()
690 struct bpf_map *map; member
708 smap = (struct bpf_local_storage_map *)info->map; in bpf_sk_storage_map_seq_find_next()
781 __bpf_md_ptr(struct bpf_map *, map);
787 struct bpf_map *map, struct sock *sk, in DEFINE_BPF_ITER_FUNC() argument
804 ctx.map = info->map; in DEFINE_BPF_ITER_FUNC()
835 bpf_map_inc_with_uref(aux->map); in bpf_iter_init_sk_storage_map()
836 seq_info->map = aux->map; in bpf_iter_init_sk_storage_map()
844 bpf_map_put_with_uref(seq_info->map); in bpf_iter_fini_sk_storage_map()
851 struct bpf_map *map; in bpf_iter_attach_map() local
854 if (!linfo->map.map_fd) in bpf_iter_attach_map()
857 map = bpf_map_get_with_uref(linfo->map.map_fd); in bpf_iter_attach_map()
858 if (IS_ERR(map)) in bpf_iter_attach_map()
859 return PTR_ERR(map); in bpf_iter_attach_map()
861 if (map->map_type != BPF_MAP_TYPE_SK_STORAGE) in bpf_iter_attach_map()
864 if (prog->aux->max_rdwr_access > map->value_size) { in bpf_iter_attach_map()
869 aux->map = map; in bpf_iter_attach_map()
873 bpf_map_put_with_uref(map); in bpf_iter_attach_map()
879 bpf_map_put_with_uref(aux->map); in bpf_iter_detach_map()