Lines Matching refs:key_size
197 static inline void htab_elem_set_ptr(struct htab_elem *l, u32 key_size, in htab_elem_set_ptr() argument
200 *(void __percpu **)(l->key + key_size) = pptr; in htab_elem_set_ptr()
203 static inline void __percpu *htab_elem_get_ptr(struct htab_elem *l, u32 key_size) in htab_elem_get_ptr() argument
205 return *(void __percpu **)(l->key + key_size); in htab_elem_get_ptr()
210 return *(void **)(l->key + roundup(map->key_size, 8)); in fd_htab_map_get_ptr()
238 round_up(htab->map.key_size, 8) + in htab_free_prealloced_timers()
258 bpf_map_free_kptrs(&htab->map, elem->key + round_up(htab->map.key_size, 8)); in htab_free_prealloced_kptrs()
274 htab->map.key_size); in htab_free_elems()
301 memcpy(l->key, key, htab->map.key_size); in prealloc_lru_pop()
332 htab_elem_set_ptr(get_htab_elem(htab, i), htab->map.key_size, in prealloc_init()
446 if (attr->max_entries == 0 || attr->key_size == 0 || in htab_map_alloc_check()
450 if ((u64)attr->key_size + attr->value_size >= KMALLOC_MAX_SIZE - in htab_map_alloc_check()
502 round_up(htab->map.key_size, 8); in htab_map_alloc()
620 void *key, u32 key_size) in lookup_elem_raw() argument
626 if (l->hash == hash && !memcmp(&l->key, key, key_size)) in lookup_elem_raw()
638 u32 key_size, u32 n_buckets) in lookup_nulls_elem_raw() argument
645 if (l->hash == hash && !memcmp(&l->key, key, key_size)) in lookup_nulls_elem_raw()
664 u32 hash, key_size; in __htab_map_lookup_elem() local
669 key_size = map->key_size; in __htab_map_lookup_elem()
671 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_map_lookup_elem()
675 l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); in __htab_map_lookup_elem()
685 return l->key + round_up(map->key_size, 8); in htab_map_lookup_elem()
712 round_up(map->key_size, 8)); in htab_map_gen_lookup()
724 return l->key + round_up(map->key_size, 8); in __htab_lru_map_lookup_elem()
761 round_up(map->key_size, 8)); in htab_lru_map_gen_lookup()
768 void *map_value = elem->key + round_up(htab->map.key_size, 8); in check_and_free_fields()
815 u32 hash, key_size; in htab_map_get_next_key() local
820 key_size = map->key_size; in htab_map_get_next_key()
825 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_get_next_key()
830 l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); in htab_map_get_next_key()
841 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
859 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
975 void *value, u32 key_size, u32 hash, in alloc_htab_elem() argument
1018 memcpy(l_new->key, key, key_size); in alloc_htab_elem()
1021 pptr = htab_elem_get_ptr(l_new, key_size); in alloc_htab_elem()
1037 htab_elem_set_ptr(l_new, key_size, pptr); in alloc_htab_elem()
1040 memcpy(l_new->key + round_up(key_size, 8), value, size); in alloc_htab_elem()
1043 l_new->key + round_up(key_size, 8), in alloc_htab_elem()
1077 u32 key_size, hash; in htab_map_update_elem() local
1087 key_size = map->key_size; in htab_map_update_elem()
1089 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_update_elem()
1098 l_old = lookup_nulls_elem_raw(head, hash, key, key_size, in htab_map_update_elem()
1106 l_old->key + round_up(key_size, 8), in htab_map_update_elem()
1120 l_old = lookup_elem_raw(head, hash, key, key_size); in htab_map_update_elem()
1134 l_old->key + round_up(key_size, 8), in htab_map_update_elem()
1140 l_new = alloc_htab_elem(htab, key, value, key_size, hash, false, false, in htab_map_update_elem()
1179 u32 key_size, hash; in htab_lru_map_update_elem() local
1189 key_size = map->key_size; in htab_lru_map_update_elem()
1191 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_lru_map_update_elem()
1205 l_new->key + round_up(map->key_size, 8), value); in htab_lru_map_update_elem()
1211 l_old = lookup_elem_raw(head, hash, key, key_size); in htab_lru_map_update_elem()
1248 u32 key_size, hash; in __htab_percpu_map_update_elem() local
1258 key_size = map->key_size; in __htab_percpu_map_update_elem()
1260 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_percpu_map_update_elem()
1269 l_old = lookup_elem_raw(head, hash, key, key_size); in __htab_percpu_map_update_elem()
1277 pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), in __htab_percpu_map_update_elem()
1280 l_new = alloc_htab_elem(htab, key, value, key_size, in __htab_percpu_map_update_elem()
1303 u32 key_size, hash; in __htab_lru_percpu_map_update_elem() local
1313 key_size = map->key_size; in __htab_lru_percpu_map_update_elem()
1315 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_lru_percpu_map_update_elem()
1335 l_old = lookup_elem_raw(head, hash, key, key_size); in __htab_lru_percpu_map_update_elem()
1345 pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), in __htab_lru_percpu_map_update_elem()
1348 pcpu_init_value(htab, htab_elem_get_ptr(l_new, key_size), in __htab_lru_percpu_map_update_elem()
1383 u32 hash, key_size; in htab_map_delete_elem() local
1389 key_size = map->key_size; in htab_map_delete_elem()
1391 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_delete_elem()
1399 l = lookup_elem_raw(head, hash, key, key_size); in htab_map_delete_elem()
1419 u32 hash, key_size; in htab_lru_map_delete_elem() local
1425 key_size = map->key_size; in htab_lru_map_delete_elem()
1427 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_lru_map_delete_elem()
1435 l = lookup_elem_raw(head, hash, key, key_size); in htab_lru_map_delete_elem()
1484 round_up(htab->map.key_size, 8) + in htab_free_malloced_timers()
1569 u32 hash, key_size; in __htab_map_lookup_and_delete_elem() local
1573 key_size = map->key_size; in __htab_map_lookup_and_delete_elem()
1575 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_map_lookup_and_delete_elem()
1583 l = lookup_elem_raw(head, hash, key, key_size); in __htab_map_lookup_and_delete_elem()
1592 pptr = htab_elem_get_ptr(l, key_size); in __htab_map_lookup_and_delete_elem()
1600 u32 roundup_key_size = round_up(map->key_size, 8); in __htab_map_lookup_and_delete_elem()
1664 u32 bucket_cnt, total, key_size, value_size, roundup_key_size; in __htab_map_lookup_and_delete_batch() local
1703 key_size = htab->map.key_size; in __htab_map_lookup_and_delete_batch()
1704 roundup_key_size = round_up(htab->map.key_size, 8); in __htab_map_lookup_and_delete_batch()
1719 keys = kvmalloc_array(key_size, bucket_size, GFP_USER | __GFP_NOWARN); in __htab_map_lookup_and_delete_batch()
1783 memcpy(dst_key, l->key, key_size); in __htab_map_lookup_and_delete_batch()
1789 pptr = htab_elem_get_ptr(l, map->key_size); in __htab_map_lookup_and_delete_batch()
1828 dst_key += key_size; in __htab_map_lookup_and_delete_batch()
1852 if (bucket_cnt && (copy_to_user(ukeys + total * key_size, keys, in __htab_map_lookup_and_delete_batch()
1853 key_size * bucket_cnt) || in __htab_map_lookup_and_delete_batch()
2057 roundup_key_size = round_up(map->key_size, 8); in __bpf_hash_map_seq_show()
2063 pptr = htab_elem_get_ptr(elem, map->key_size); in __bpf_hash_map_seq_show()
2158 roundup_key_size = round_up(map->key_size, 8); in bpf_for_each_hash_elem()
2172 pptr = htab_elem_get_ptr(elem, map->key_size); in bpf_for_each_hash_elem()
2242 return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); in htab_percpu_map_lookup_elem()
2256 return per_cpu_ptr(htab_elem_get_ptr(l, map->key_size), cpu); in htab_percpu_map_lookup_percpu_elem()
2267 return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); in htab_lru_percpu_map_lookup_elem()
2283 return per_cpu_ptr(htab_elem_get_ptr(l, map->key_size), cpu); in htab_lru_percpu_map_lookup_percpu_elem()
2309 pptr = htab_elem_get_ptr(l, map->key_size); in bpf_percpu_hash_copy()
2356 pptr = htab_elem_get_ptr(l, map->key_size); in htab_percpu_map_seq_show_elem()
2514 round_up(map->key_size, 8)); in htab_of_map_gen_lookup()