Lines Matching refs:map
12 struct bpf_map map; member
16 static struct reuseport_array *reuseport_array(struct bpf_map *map) in reuseport_array() argument
18 return (struct reuseport_array *)map; in reuseport_array()
50 static void *reuseport_array_lookup_elem(struct bpf_map *map, void *key) in reuseport_array_lookup_elem() argument
52 struct reuseport_array *array = reuseport_array(map); in reuseport_array_lookup_elem()
55 if (unlikely(index >= array->map.max_entries)) in reuseport_array_lookup_elem()
62 static int reuseport_array_delete_elem(struct bpf_map *map, void *key) in reuseport_array_delete_elem() argument
64 struct reuseport_array *array = reuseport_array(map); in reuseport_array_delete_elem()
69 if (index >= map->max_entries) in reuseport_array_delete_elem()
94 static void reuseport_array_free(struct bpf_map *map) in reuseport_array_free() argument
96 struct reuseport_array *array = reuseport_array(map); in reuseport_array_free()
126 for (i = 0; i < map->max_entries; i++) { in reuseport_array_free()
163 bpf_map_init_from_attr(&array->map, attr); in reuseport_array_alloc()
165 return &array->map; in reuseport_array_alloc()
168 int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_lookup_elem() argument
174 if (map->value_size != sizeof(u64)) in bpf_fd_reuseport_array_lookup_elem()
178 sk = reuseport_array_lookup_elem(map, key); in bpf_fd_reuseport_array_lookup_elem()
235 int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key, in bpf_fd_reuseport_array_update_elem() argument
238 struct reuseport_array *array = reuseport_array(map); in bpf_fd_reuseport_array_update_elem()
249 if (index >= map->max_entries) in bpf_fd_reuseport_array_update_elem()
252 if (map->value_size == sizeof(u64)) { in bpf_fd_reuseport_array_update_elem()
319 static int reuseport_array_get_next_key(struct bpf_map *map, void *key, in reuseport_array_get_next_key() argument
322 struct reuseport_array *array = reuseport_array(map); in reuseport_array_get_next_key()
326 if (index >= array->map.max_entries) { in reuseport_array_get_next_key()
331 if (index == array->map.max_entries - 1) in reuseport_array_get_next_key()