Lines Matching refs:map

18 	struct bpf_map map;  member
26 static struct bpf_queue_stack *bpf_queue_stack(struct bpf_map *map) in bpf_queue_stack() argument
28 return container_of(map, struct bpf_queue_stack, map); in bpf_queue_stack()
78 bpf_map_init_from_attr(&qs->map, attr); in queue_stack_map_alloc()
84 return &qs->map; in queue_stack_map_alloc()
88 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free() argument
90 struct bpf_queue_stack *qs = bpf_queue_stack(map); in queue_stack_map_free()
95 static long __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get() argument
97 struct bpf_queue_stack *qs = bpf_queue_stack(map); in __queue_map_get()
106 memset(value, 0, qs->map.value_size); in __queue_map_get()
111 ptr = &qs->elements[qs->tail * qs->map.value_size]; in __queue_map_get()
112 memcpy(value, ptr, qs->map.value_size); in __queue_map_get()
125 static long __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() argument
127 struct bpf_queue_stack *qs = bpf_queue_stack(map); in __stack_map_get()
137 memset(value, 0, qs->map.value_size); in __stack_map_get()
146 ptr = &qs->elements[index * qs->map.value_size]; in __stack_map_get()
147 memcpy(value, ptr, qs->map.value_size); in __stack_map_get()
158 static long queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() argument
160 return __queue_map_get(map, value, false); in queue_map_peek_elem()
164 static long stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() argument
166 return __stack_map_get(map, value, false); in stack_map_peek_elem()
170 static long queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() argument
172 return __queue_map_get(map, value, true); in queue_map_pop_elem()
176 static long stack_map_pop_elem(struct bpf_map *map, void *value) in stack_map_pop_elem() argument
178 return __stack_map_get(map, value, true); in stack_map_pop_elem()
182 static long queue_stack_map_push_elem(struct bpf_map *map, void *value, in queue_stack_map_push_elem() argument
185 struct bpf_queue_stack *qs = bpf_queue_stack(map); in queue_stack_map_push_elem()
212 dst = &qs->elements[qs->head * qs->map.value_size]; in queue_stack_map_push_elem()
213 memcpy(dst, value, qs->map.value_size); in queue_stack_map_push_elem()
224 static void *queue_stack_map_lookup_elem(struct bpf_map *map, void *key) in queue_stack_map_lookup_elem() argument
230 static long queue_stack_map_update_elem(struct bpf_map *map, void *key, in queue_stack_map_update_elem() argument
237 static long queue_stack_map_delete_elem(struct bpf_map *map, void *key) in queue_stack_map_delete_elem() argument
243 static int queue_stack_map_get_next_key(struct bpf_map *map, void *key, in queue_stack_map_get_next_key() argument
249 static u64 queue_stack_map_mem_usage(const struct bpf_map *map) in queue_stack_map_mem_usage() argument
253 usage += ((u64)map->max_entries + 1) * map->value_size; in queue_stack_map_mem_usage()