Lines Matching refs:map
18 struct bpf_map map; member
45 htab->map.key_size = attr->key_size; in htab_map_alloc()
46 htab->map.value_size = attr->value_size; in htab_map_alloc()
47 htab->map.max_entries = attr->max_entries; in htab_map_alloc()
53 if (htab->map.max_entries == 0 || htab->map.key_size == 0 || in htab_map_alloc()
54 htab->map.value_size == 0) in htab_map_alloc()
58 htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); in htab_map_alloc()
61 if (htab->map.key_size > MAX_BPF_STACK) in htab_map_alloc()
67 if (htab->map.value_size >= (1 << (KMALLOC_SHIFT_MAX - 1)) - in htab_map_alloc()
77 round_up(htab->map.key_size, 8) + in htab_map_alloc()
78 htab->map.value_size; in htab_map_alloc()
86 (u64) htab->elem_size * htab->map.max_entries >= in htab_map_alloc()
91 htab->map.pages = round_up(htab->n_buckets * sizeof(struct hlist_head) + in htab_map_alloc()
92 htab->elem_size * htab->map.max_entries, in htab_map_alloc()
111 return &htab->map; in htab_map_alloc()
141 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem() argument
143 struct bpf_htab *htab = container_of(map, struct bpf_htab, map); in htab_map_lookup_elem()
151 key_size = map->key_size; in htab_map_lookup_elem()
160 return l->key + round_up(map->key_size, 8); in htab_map_lookup_elem()
166 static int htab_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in htab_map_get_next_key() argument
168 struct bpf_htab *htab = container_of(map, struct bpf_htab, map); in htab_map_get_next_key()
176 key_size = map->key_size; in htab_map_get_next_key()
224 static int htab_map_update_elem(struct bpf_map *map, void *key, void *value, in htab_map_update_elem() argument
227 struct bpf_htab *htab = container_of(map, struct bpf_htab, map); in htab_map_update_elem()
245 key_size = map->key_size; in htab_map_update_elem()
248 memcpy(l_new->key + round_up(key_size, 8), value, map->value_size); in htab_map_update_elem()
259 if (!l_old && unlikely(htab->count >= map->max_entries)) { in htab_map_update_elem()
299 static int htab_map_delete_elem(struct bpf_map *map, void *key) in htab_map_delete_elem() argument
301 struct bpf_htab *htab = container_of(map, struct bpf_htab, map); in htab_map_delete_elem()
310 key_size = map->key_size; in htab_map_delete_elem()
349 static void htab_map_free(struct bpf_map *map) in htab_map_free() argument
351 struct bpf_htab *htab = container_of(map, struct bpf_htab, map); in htab_map_free()