Lines Matching refs:index
157 static void *array_map_elem_ptr(struct bpf_array* array, u32 index) in array_map_elem_ptr() argument
159 return array->value + (u64)array->elem_size * index; in array_map_elem_ptr()
166 u32 index = *(u32 *)key; in array_map_lookup_elem() local
168 if (unlikely(index >= array->map.max_entries)) in array_map_lookup_elem()
171 return array->value + (u64)array->elem_size * (index & array->index_mask); in array_map_lookup_elem()
212 const int index = BPF_REG_2; in array_map_gen_lookup() local
218 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_map_gen_lookup()
241 u32 index = *(u32 *)key; in percpu_array_map_lookup_elem() local
243 if (unlikely(index >= array->map.max_entries)) in percpu_array_map_lookup_elem()
246 return this_cpu_ptr(array->pptrs[index & array->index_mask]); in percpu_array_map_lookup_elem()
252 u32 index = *(u32 *)key; in percpu_array_map_lookup_percpu_elem() local
257 if (unlikely(index >= array->map.max_entries)) in percpu_array_map_lookup_percpu_elem()
260 return per_cpu_ptr(array->pptrs[index & array->index_mask], cpu); in percpu_array_map_lookup_percpu_elem()
266 u32 index = *(u32 *)key; in bpf_percpu_array_copy() local
271 if (unlikely(index >= array->map.max_entries)) in bpf_percpu_array_copy()
280 pptr = array->pptrs[index & array->index_mask]; in bpf_percpu_array_copy()
294 u32 index = key ? *(u32 *)key : U32_MAX; in array_map_get_next_key() local
297 if (index >= array->map.max_entries) { in array_map_get_next_key()
302 if (index == array->map.max_entries - 1) in array_map_get_next_key()
305 *next = index + 1; in array_map_get_next_key()
322 u32 index = *(u32 *)key; in array_map_update_elem() local
329 if (unlikely(index >= array->map.max_entries)) in array_map_update_elem()
342 val = this_cpu_ptr(array->pptrs[index & array->index_mask]); in array_map_update_elem()
347 (u64)array->elem_size * (index & array->index_mask); in array_map_update_elem()
361 u32 index = *(u32 *)key; in bpf_percpu_array_update() local
370 if (unlikely(index >= array->map.max_entries)) in bpf_percpu_array_update()
386 pptr = array->pptrs[index & array->index_mask]; in bpf_percpu_array_update()
478 u32 index = *(u32 *)key; in percpu_array_map_seq_show_elem() local
485 pptr = array->pptrs[index & array->index_mask]; in percpu_array_map_seq_show_elem()
557 u32 index; member
565 u32 index; in bpf_array_map_seq_start() local
567 if (info->index >= map->max_entries) in bpf_array_map_seq_start()
573 index = info->index & array->index_mask; in bpf_array_map_seq_start()
575 return array->pptrs[index]; in bpf_array_map_seq_start()
576 return array_map_elem_ptr(array, index); in bpf_array_map_seq_start()
584 u32 index; in bpf_array_map_seq_next() local
587 ++info->index; in bpf_array_map_seq_next()
588 if (info->index >= map->max_entries) in bpf_array_map_seq_next()
592 index = info->index & array->index_mask; in bpf_array_map_seq_next()
594 return array->pptrs[index]; in bpf_array_map_seq_next()
595 return array_map_elem_ptr(array, index); in bpf_array_map_seq_next()
618 ctx.key = &info->index; in __bpf_array_map_seq_show()
832 u32 index = *(u32 *)key, ufd; in bpf_fd_array_map_update_elem() local
837 if (index >= array->map.max_entries) in bpf_fd_array_map_update_elem()
847 old_ptr = xchg(array->ptrs + index, new_ptr); in bpf_fd_array_map_update_elem()
848 map->ops->map_poke_run(map, index, old_ptr, new_ptr); in bpf_fd_array_map_update_elem()
851 old_ptr = xchg(array->ptrs + index, new_ptr); in bpf_fd_array_map_update_elem()
863 u32 index = *(u32 *)key; in fd_array_map_delete_elem() local
865 if (index >= array->map.max_entries) in fd_array_map_delete_elem()
870 old_ptr = xchg(array->ptrs + index, NULL); in fd_array_map_delete_elem()
871 map->ops->map_poke_run(map, index, old_ptr, NULL); in fd_array_map_delete_elem()
874 old_ptr = xchg(array->ptrs + index, NULL); in fd_array_map_delete_elem()
1316 const int index = BPF_REG_2; in array_of_map_gen_lookup() local
1319 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_of_map_gen_lookup()