Lines Matching refs:key
54 char key[0] __aligned(8); member
60 *(void __percpu **)(l->key + key_size) = pptr; in htab_elem_set_ptr()
65 return *(void __percpu **)(l->key + key_size); in htab_elem_get_ptr()
265 static inline u32 htab_map_hash(const void *key, u32 key_len) in htab_map_hash() argument
267 return jhash(key, key_len, 0); in htab_map_hash()
281 void *key, u32 key_size) in lookup_elem_raw() argument
286 if (l->hash == hash && !memcmp(&l->key, key, key_size)) in lookup_elem_raw()
293 static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) in __htab_map_lookup_elem() argument
305 hash = htab_map_hash(key, key_size); in __htab_map_lookup_elem()
309 l = lookup_elem_raw(head, hash, key, key_size); in __htab_map_lookup_elem()
314 static void *htab_map_lookup_elem(struct bpf_map *map, void *key) in htab_map_lookup_elem() argument
316 struct htab_elem *l = __htab_map_lookup_elem(map, key); in htab_map_lookup_elem()
319 return l->key + round_up(map->key_size, 8); in htab_map_lookup_elem()
325 static int htab_map_get_next_key(struct bpf_map *map, void *key, void *next_key) in htab_map_get_next_key() argument
337 hash = htab_map_hash(key, key_size); in htab_map_get_next_key()
342 l = lookup_elem_raw(head, hash, key, key_size); in htab_map_get_next_key()
355 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
373 memcpy(next_key, next_l->key, key_size); in htab_map_get_next_key()
421 static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key, in alloc_htab_elem() argument
463 memcpy(l_new->key, key, key_size); in alloc_htab_elem()
495 memcpy(l_new->key + round_up(key_size, 8), value, size); in alloc_htab_elem()
517 static int htab_map_update_elem(struct bpf_map *map, void *key, void *value, in htab_map_update_elem() argument
536 hash = htab_map_hash(key, key_size); in htab_map_update_elem()
544 l_old = lookup_elem_raw(head, hash, key, key_size); in htab_map_update_elem()
550 l_new = alloc_htab_elem(htab, key, value, key_size, hash, false, false, in htab_map_update_elem()
572 static int __htab_percpu_map_update_elem(struct bpf_map *map, void *key, in __htab_percpu_map_update_elem() argument
592 hash = htab_map_hash(key, key_size); in __htab_percpu_map_update_elem()
600 l_old = lookup_elem_raw(head, hash, key, key_size); in __htab_percpu_map_update_elem()
624 l_new = alloc_htab_elem(htab, key, value, key_size, in __htab_percpu_map_update_elem()
638 static int htab_percpu_map_update_elem(struct bpf_map *map, void *key, in htab_percpu_map_update_elem() argument
641 return __htab_percpu_map_update_elem(map, key, value, map_flags, false); in htab_percpu_map_update_elem()
645 static int htab_map_delete_elem(struct bpf_map *map, void *key) in htab_map_delete_elem() argument
659 hash = htab_map_hash(key, key_size); in htab_map_delete_elem()
665 l = lookup_elem_raw(head, hash, key, key_size); in htab_map_delete_elem()
735 static void *htab_percpu_map_lookup_elem(struct bpf_map *map, void *key) in htab_percpu_map_lookup_elem() argument
737 struct htab_elem *l = __htab_map_lookup_elem(map, key); in htab_percpu_map_lookup_elem()
745 int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value) in bpf_percpu_hash_copy() argument
759 l = __htab_map_lookup_elem(map, key); in bpf_percpu_hash_copy()
774 int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value, in bpf_percpu_hash_update() argument
780 ret = __htab_percpu_map_update_elem(map, key, value, map_flags, true); in bpf_percpu_hash_update()