Lines Matching refs:map
16 struct bpf_map *map; in bpf_map_seq_start() local
18 map = bpf_map_get_curr_or_next(&info->map_id); in bpf_map_seq_start()
19 if (!map) in bpf_map_seq_start()
24 return map; in bpf_map_seq_start()
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
52 ctx.map = v; in DEFINE_BPF_ITER_FUNC()
94 { offsetof(struct bpf_iter__bpf_map, map),
105 struct bpf_map *map; in bpf_iter_attach_map() local
109 if (!linfo->map.map_fd) in bpf_iter_attach_map()
112 map = bpf_map_get_with_uref(linfo->map.map_fd); in bpf_iter_attach_map()
113 if (IS_ERR(map)) in bpf_iter_attach_map()
114 return PTR_ERR(map); in bpf_iter_attach_map()
116 if (map->map_type == BPF_MAP_TYPE_PERCPU_HASH || in bpf_iter_attach_map()
117 map->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH || in bpf_iter_attach_map()
118 map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) in bpf_iter_attach_map()
120 else if (map->map_type != BPF_MAP_TYPE_HASH && in bpf_iter_attach_map()
121 map->map_type != BPF_MAP_TYPE_LRU_HASH && in bpf_iter_attach_map()
122 map->map_type != BPF_MAP_TYPE_ARRAY) in bpf_iter_attach_map()
127 key_size = map->key_size; in bpf_iter_attach_map()
129 value_size = map->value_size; in bpf_iter_attach_map()
131 value_size = round_up(map->value_size, 8) * num_possible_cpus(); in bpf_iter_attach_map()
138 aux->map = map; in bpf_iter_attach_map()
142 bpf_map_put_with_uref(map); in bpf_iter_attach_map()
148 bpf_map_put_with_uref(aux->map); in bpf_iter_detach_map()
154 seq_printf(seq, "map_id:\t%u\n", aux->map->id); in bpf_iter_map_show_fdinfo()
160 info->iter.map.map_id = aux->map->id; in bpf_iter_map_fill_link_info()
165 struct bpf_map *map, void *key, void *value)
198 __bpf_kfunc s64 bpf_map_sum_elem_count(const struct bpf_map *map) in bpf_map_sum_elem_count() argument
204 if (!map || !map->elem_count) in bpf_map_sum_elem_count()
208 pcount = per_cpu_ptr(map->elem_count, cpu); in bpf_map_sum_elem_count()