Lines Matching full:array
52 struct reuseport_array *array = reuseport_array(map); in reuseport_array_lookup_elem() local
55 if (unlikely(index >= array->map.max_entries)) in reuseport_array_lookup_elem()
58 return rcu_dereference(array->ptrs[index]); in reuseport_array_lookup_elem()
64 struct reuseport_array *array = reuseport_array(map); in reuseport_array_delete_elem() local
72 if (!rcu_access_pointer(array->ptrs[index])) in reuseport_array_delete_elem()
77 sk = rcu_dereference_protected(array->ptrs[index], in reuseport_array_delete_elem()
82 RCU_INIT_POINTER(array->ptrs[index], NULL); in reuseport_array_delete_elem()
96 struct reuseport_array *array = reuseport_array(map); in reuseport_array_free() local
102 * array now. Hence, this function only races with in reuseport_array_free()
107 * both removing sk from "array". Who removes it in reuseport_array_free()
111 * may access "array" which is being freed here. in reuseport_array_free()
112 * bpf_sk_reuseport_detach() access this "array" in reuseport_array_free()
114 * held which is enough because this "array" is not freed in reuseport_array_free()
115 * until all sk->sk_user_data has stopped referencing this "array". in reuseport_array_free()
127 sk = rcu_dereference(array->ptrs[i]); in reuseport_array_free()
137 RCU_INIT_POINTER(array->ptrs[i], NULL); in reuseport_array_free()
144 * referencing this "array". "array" can be freed now. in reuseport_array_free()
146 bpf_map_area_free(array); in reuseport_array_free()
152 struct reuseport_array *array; in reuseport_array_alloc() local
155 array = bpf_map_area_alloc(struct_size(array, ptrs, attr->max_entries), numa_node); in reuseport_array_alloc()
156 if (!array) in reuseport_array_alloc()
160 bpf_map_init_from_attr(&array->map, attr); in reuseport_array_alloc()
162 return &array->map; in reuseport_array_alloc()
188 reuseport_array_update_check(const struct reuseport_array *array, in reuseport_array_update_check() argument
235 struct reuseport_array *array = reuseport_array(map); in bpf_fd_reuseport_array_update_elem() local
270 err = reuseport_array_update_check(array, nsk, in bpf_fd_reuseport_array_update_elem()
271 rcu_access_pointer(array->ptrs[index]), in bpf_fd_reuseport_array_update_elem()
285 osk = rcu_dereference_protected(array->ptrs[index], in bpf_fd_reuseport_array_update_elem()
289 err = reuseport_array_update_check(array, nsk, osk, reuse, map_flags); in bpf_fd_reuseport_array_update_elem()
293 sk_user_data = (uintptr_t)&array->ptrs[index] | SK_USER_DATA_NOCOPY | in bpf_fd_reuseport_array_update_elem()
296 rcu_assign_pointer(array->ptrs[index], nsk); in bpf_fd_reuseport_array_update_elem()
319 struct reuseport_array *array = reuseport_array(map); in reuseport_array_get_next_key() local
323 if (index >= array->map.max_entries) { in reuseport_array_get_next_key()
328 if (index == array->map.max_entries - 1) in reuseport_array_get_next_key()
337 struct reuseport_array *array; in reuseport_array_mem_usage() local
339 return struct_size(array, ptrs, map->max_entries); in reuseport_array_mem_usage()