Lines Matching refs:key_size
198 static inline void htab_elem_set_ptr(struct htab_elem *l, u32 key_size, in htab_elem_set_ptr() argument
201 *(void __percpu **)(l->key + key_size) = pptr; in htab_elem_set_ptr()
204 static inline void __percpu *htab_elem_get_ptr(struct htab_elem *l, u32 key_size) in htab_elem_get_ptr() argument
206 return *(void __percpu **)(l->key + key_size); in htab_elem_get_ptr()
211 return *(void **)(l->key + roundup(map->key_size, 8)); in fd_htab_map_get_ptr()
238 elem->key + round_up(htab->map.key_size, 8)); in htab_free_prealloced_timers_and_wq()
241 elem->key + round_up(htab->map.key_size, 8)); in htab_free_prealloced_timers_and_wq()
260 void __percpu *pptr = htab_elem_get_ptr(elem, htab->map.key_size); in htab_free_prealloced_fields()
268 bpf_obj_free_fields(htab->map.record, elem->key + round_up(htab->map.key_size, 8)); in htab_free_prealloced_fields()
286 htab->map.key_size); in htab_free_elems()
314 memcpy(l->key, key, htab->map.key_size); in prealloc_lru_pop()
345 htab_elem_set_ptr(get_htab_elem(htab, i), htab->map.key_size, in prealloc_init()
453 if (attr->max_entries == 0 || attr->key_size == 0 || in htab_map_alloc_check()
457 if ((u64)attr->key_size + attr->value_size >= KMALLOC_MAX_SIZE - in htab_map_alloc_check()
518 round_up(htab->map.key_size, 8); in htab_map_alloc()
642 void *key, u32 key_size) in lookup_elem_raw() argument
648 if (l->hash == hash && !memcmp(&l->key, key, key_size)) in lookup_elem_raw()
660 u32 key_size, u32 n_buckets) in lookup_nulls_elem_raw() argument
667 if (l->hash == hash && !memcmp(&l->key, key, key_size)) in lookup_nulls_elem_raw()
686 u32 hash, key_size; in __htab_map_lookup_elem() local
691 key_size = map->key_size; in __htab_map_lookup_elem()
693 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_map_lookup_elem()
697 l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); in __htab_map_lookup_elem()
707 return l->key + round_up(map->key_size, 8); in htab_map_lookup_elem()
734 round_up(map->key_size, 8)); in htab_map_gen_lookup()
746 return l->key + round_up(map->key_size, 8); in __htab_lru_map_lookup_elem()
783 round_up(map->key_size, 8)); in htab_lru_map_gen_lookup()
791 void __percpu *pptr = htab_elem_get_ptr(elem, htab->map.key_size); in check_and_free_fields()
797 void *map_value = elem->key + round_up(htab->map.key_size, 8); in check_and_free_fields()
843 u32 hash, key_size; in htab_map_get_next_key() local
848 key_size = map->key_size; in htab_map_get_next_key()
853 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_get_next_key()
858 l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); in htab_map_get_next_key()
869 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
887 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
1005 void *value, u32 key_size, u32 hash, in alloc_htab_elem() argument
1049 memcpy(l_new->key, key, key_size); in alloc_htab_elem()
1052 pptr = htab_elem_get_ptr(l_new, key_size); in alloc_htab_elem()
1069 htab_elem_set_ptr(l_new, key_size, pptr); in alloc_htab_elem()
1072 memcpy(l_new->key + round_up(key_size, 8), value, size); in alloc_htab_elem()
1075 l_new->key + round_up(key_size, 8), in alloc_htab_elem()
1109 u32 key_size, hash; in htab_map_update_elem() local
1119 key_size = map->key_size; in htab_map_update_elem()
1121 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_update_elem()
1130 l_old = lookup_nulls_elem_raw(head, hash, key, key_size, in htab_map_update_elem()
1138 l_old->key + round_up(key_size, 8), in htab_map_update_elem()
1152 l_old = lookup_elem_raw(head, hash, key, key_size); in htab_map_update_elem()
1166 l_old->key + round_up(key_size, 8), in htab_map_update_elem()
1172 l_new = alloc_htab_elem(htab, key, value, key_size, hash, false, false, in htab_map_update_elem()
1212 u32 key_size, hash; in htab_lru_map_update_elem() local
1222 key_size = map->key_size; in htab_lru_map_update_elem()
1224 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_lru_map_update_elem()
1238 l_new->key + round_up(map->key_size, 8), value); in htab_lru_map_update_elem()
1244 l_old = lookup_elem_raw(head, hash, key, key_size); in htab_lru_map_update_elem()
1281 u32 key_size, hash; in __htab_percpu_map_update_elem() local
1291 key_size = map->key_size; in __htab_percpu_map_update_elem()
1293 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_percpu_map_update_elem()
1302 l_old = lookup_elem_raw(head, hash, key, key_size); in __htab_percpu_map_update_elem()
1310 pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), in __htab_percpu_map_update_elem()
1313 l_new = alloc_htab_elem(htab, key, value, key_size, in __htab_percpu_map_update_elem()
1336 u32 key_size, hash; in __htab_lru_percpu_map_update_elem() local
1346 key_size = map->key_size; in __htab_lru_percpu_map_update_elem()
1348 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_lru_percpu_map_update_elem()
1368 l_old = lookup_elem_raw(head, hash, key, key_size); in __htab_lru_percpu_map_update_elem()
1378 pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), in __htab_lru_percpu_map_update_elem()
1381 pcpu_init_value(htab, htab_elem_get_ptr(l_new, key_size), in __htab_lru_percpu_map_update_elem()
1418 u32 hash, key_size; in htab_map_delete_elem() local
1424 key_size = map->key_size; in htab_map_delete_elem()
1426 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_map_delete_elem()
1434 l = lookup_elem_raw(head, hash, key, key_size); in htab_map_delete_elem()
1454 u32 hash, key_size; in htab_lru_map_delete_elem() local
1460 key_size = map->key_size; in htab_lru_map_delete_elem()
1462 hash = htab_map_hash(key, key_size, htab->hashrnd); in htab_lru_map_delete_elem()
1470 l = lookup_elem_raw(head, hash, key, key_size); in htab_lru_map_delete_elem()
1519 l->key + round_up(htab->map.key_size, 8)); in htab_free_malloced_timers_and_wq()
1522 l->key + round_up(htab->map.key_size, 8)); in htab_free_malloced_timers_and_wq()
1606 u32 hash, key_size; in __htab_map_lookup_and_delete_elem() local
1610 key_size = map->key_size; in __htab_map_lookup_and_delete_elem()
1612 hash = htab_map_hash(key, key_size, htab->hashrnd); in __htab_map_lookup_and_delete_elem()
1620 l = lookup_elem_raw(head, hash, key, key_size); in __htab_map_lookup_and_delete_elem()
1629 pptr = htab_elem_get_ptr(l, key_size); in __htab_map_lookup_and_delete_elem()
1636 u32 roundup_key_size = round_up(map->key_size, 8); in __htab_map_lookup_and_delete_elem()
1700 u32 bucket_cnt, total, key_size, value_size, roundup_key_size; in __htab_map_lookup_and_delete_batch() local
1739 key_size = htab->map.key_size; in __htab_map_lookup_and_delete_batch()
1740 roundup_key_size = round_up(htab->map.key_size, 8); in __htab_map_lookup_and_delete_batch()
1755 keys = kvmalloc_array(key_size, bucket_size, GFP_USER | __GFP_NOWARN); in __htab_map_lookup_and_delete_batch()
1819 memcpy(dst_key, l->key, key_size); in __htab_map_lookup_and_delete_batch()
1825 pptr = htab_elem_get_ptr(l, map->key_size); in __htab_map_lookup_and_delete_batch()
1864 dst_key += key_size; in __htab_map_lookup_and_delete_batch()
1888 if (bucket_cnt && (copy_to_user(ukeys + total * key_size, keys, in __htab_map_lookup_and_delete_batch()
1889 key_size * bucket_cnt) || in __htab_map_lookup_and_delete_batch()
2093 roundup_key_size = round_up(map->key_size, 8); in __bpf_hash_map_seq_show()
2099 pptr = htab_elem_get_ptr(elem, map->key_size); in __bpf_hash_map_seq_show()
2194 roundup_key_size = round_up(map->key_size, 8); in bpf_for_each_hash_elem()
2208 pptr = htab_elem_get_ptr(elem, map->key_size); in bpf_for_each_hash_elem()
2318 return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); in htab_percpu_map_lookup_elem()
2336 offsetof(struct htab_elem, key) + map->key_size); in htab_percpu_map_gen_lookup()
2352 return per_cpu_ptr(htab_elem_get_ptr(l, map->key_size), cpu); in htab_percpu_map_lookup_percpu_elem()
2363 return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); in htab_lru_percpu_map_lookup_elem()
2379 return per_cpu_ptr(htab_elem_get_ptr(l, map->key_size), cpu); in htab_lru_percpu_map_lookup_percpu_elem()
2405 pptr = htab_elem_get_ptr(l, map->key_size); in bpf_percpu_hash_copy()
2452 pptr = htab_elem_get_ptr(l, map->key_size); in htab_percpu_map_seq_show_elem()
2619 round_up(map->key_size, 8)); in htab_of_map_gen_lookup()