Lines Matching refs:array

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