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()
81 bpf_map_init_from_attr(&qs->map, attr); in queue_stack_map_alloc()
87 return &qs->map; in queue_stack_map_alloc()
91 static void queue_stack_map_free(struct bpf_map *map) in queue_stack_map_free() argument
93 struct bpf_queue_stack *qs = bpf_queue_stack(map); in queue_stack_map_free()
98 static int __queue_map_get(struct bpf_map *map, void *value, bool delete) in __queue_map_get() argument
100 struct bpf_queue_stack *qs = bpf_queue_stack(map); in __queue_map_get()
113 memset(value, 0, qs->map.value_size); in __queue_map_get()
118 ptr = &qs->elements[qs->tail * qs->map.value_size]; in __queue_map_get()
119 memcpy(value, ptr, qs->map.value_size); in __queue_map_get()
132 static int __stack_map_get(struct bpf_map *map, void *value, bool delete) in __stack_map_get() argument
134 struct bpf_queue_stack *qs = bpf_queue_stack(map); in __stack_map_get()
148 memset(value, 0, qs->map.value_size); in __stack_map_get()
157 ptr = &qs->elements[index * qs->map.value_size]; in __stack_map_get()
158 memcpy(value, ptr, qs->map.value_size); in __stack_map_get()
169 static int queue_map_peek_elem(struct bpf_map *map, void *value) in queue_map_peek_elem() argument
171 return __queue_map_get(map, value, false); in queue_map_peek_elem()
175 static int stack_map_peek_elem(struct bpf_map *map, void *value) in stack_map_peek_elem() argument
177 return __stack_map_get(map, value, false); in stack_map_peek_elem()
181 static int queue_map_pop_elem(struct bpf_map *map, void *value) in queue_map_pop_elem() argument
183 return __queue_map_get(map, value, true); in queue_map_pop_elem()
187 static int stack_map_pop_elem(struct bpf_map *map, void *value) in stack_map_pop_elem() argument
189 return __stack_map_get(map, value, true); in stack_map_pop_elem()
193 static int queue_stack_map_push_elem(struct bpf_map *map, void *value, in queue_stack_map_push_elem() argument
196 struct bpf_queue_stack *qs = bpf_queue_stack(map); in queue_stack_map_push_elem()
227 dst = &qs->elements[qs->head * qs->map.value_size]; in queue_stack_map_push_elem()
228 memcpy(dst, value, qs->map.value_size); in queue_stack_map_push_elem()
239 static void *queue_stack_map_lookup_elem(struct bpf_map *map, void *key) in queue_stack_map_lookup_elem() argument
245 static int queue_stack_map_update_elem(struct bpf_map *map, void *key, in queue_stack_map_update_elem() argument
252 static int queue_stack_map_delete_elem(struct bpf_map *map, void *key) in queue_stack_map_delete_elem() argument
258 static int queue_stack_map_get_next_key(struct bpf_map *map, void *key, in queue_stack_map_get_next_key() argument