Lines Matching refs:cmap
60 struct bpf_cpu_map *cmap; member
86 struct bpf_cpu_map *cmap; in cpu_map_alloc() local
99 cmap = kzalloc(sizeof(*cmap), GFP_USER | __GFP_ACCOUNT); in cpu_map_alloc()
100 if (!cmap) in cpu_map_alloc()
103 bpf_map_init_from_attr(&cmap->map, attr); in cpu_map_alloc()
106 if (cmap->map.max_entries > NR_CPUS) { in cpu_map_alloc()
112 cmap->cpu_map = bpf_map_area_alloc(cmap->map.max_entries * in cpu_map_alloc()
114 cmap->map.numa_node); in cpu_map_alloc()
115 if (!cmap->cpu_map) in cpu_map_alloc()
118 return &cmap->map; in cpu_map_alloc()
120 kfree(cmap); in cpu_map_alloc()
528 static void __cpu_map_entry_replace(struct bpf_cpu_map *cmap, in __cpu_map_entry_replace() argument
533 old_rcpu = unrcu_pointer(xchg(&cmap->cpu_map[key_cpu], RCU_INITIALIZER(rcpu))); in __cpu_map_entry_replace()
543 struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); in cpu_map_delete_elem() local
550 __cpu_map_entry_replace(cmap, key_cpu, NULL); in cpu_map_delete_elem()
557 struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); in cpu_map_update_elem() local
567 if (unlikely(key_cpu >= cmap->map.max_entries)) in cpu_map_update_elem()
585 rcpu->cmap = cmap; in cpu_map_update_elem()
588 __cpu_map_entry_replace(cmap, key_cpu, rcpu); in cpu_map_update_elem()
595 struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); in cpu_map_free() local
612 for (i = 0; i < cmap->map.max_entries; i++) { in cpu_map_free()
615 rcpu = rcu_dereference_raw(cmap->cpu_map[i]); in cpu_map_free()
620 __cpu_map_entry_replace(cmap, i, NULL); /* call_rcu */ in cpu_map_free()
622 bpf_map_area_free(cmap->cpu_map); in cpu_map_free()
623 kfree(cmap); in cpu_map_free()
632 struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); in __cpu_map_lookup_elem() local
638 rcpu = rcu_dereference_check(cmap->cpu_map[key], in __cpu_map_lookup_elem()
653 struct bpf_cpu_map *cmap = container_of(map, struct bpf_cpu_map, map); in cpu_map_get_next_key() local
657 if (index >= cmap->map.max_entries) { in cpu_map_get_next_key()
662 if (index == cmap->map.max_entries - 1) in cpu_map_get_next_key()