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
158 array = bpf_map_area_alloc(struct_size(array, ptrs, attr->max_entries), numa_node); in reuseport_array_alloc()
159 if (!array) in reuseport_array_alloc()
163 bpf_map_init_from_attr(&array->map, attr); in reuseport_array_alloc()
165 return &array->map; in reuseport_array_alloc()
191 reuseport_array_update_check(const struct reuseport_array *array, in reuseport_array_update_check() argument
238 struct reuseport_array *array = reuseport_array(map); in bpf_fd_reuseport_array_update_elem() local
273 err = reuseport_array_update_check(array, nsk, in bpf_fd_reuseport_array_update_elem()
274 rcu_access_pointer(array->ptrs[index]), in bpf_fd_reuseport_array_update_elem()
288 osk = rcu_dereference_protected(array->ptrs[index], in bpf_fd_reuseport_array_update_elem()
292 err = reuseport_array_update_check(array, nsk, osk, reuse, map_flags); in bpf_fd_reuseport_array_update_elem()
296 sk_user_data = (uintptr_t)&array->ptrs[index] | SK_USER_DATA_NOCOPY | in bpf_fd_reuseport_array_update_elem()
299 rcu_assign_pointer(array->ptrs[index], nsk); in bpf_fd_reuseport_array_update_elem()
322 struct reuseport_array *array = reuseport_array(map); in reuseport_array_get_next_key() local
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()