/linux-6.12.1/kernel/bpf/ |
D | hashtab.c | 132 static inline bool htab_is_prealloc(const struct bpf_htab *htab) in htab_is_prealloc() argument 134 return !(htab->map.map_flags & BPF_F_NO_PREALLOC); in htab_is_prealloc() 137 static void htab_init_buckets(struct bpf_htab *htab) in htab_init_buckets() argument 141 for (i = 0; i < htab->n_buckets; i++) { in htab_init_buckets() 142 INIT_HLIST_NULLS_HEAD(&htab->buckets[i].head, i); in htab_init_buckets() 143 raw_spin_lock_init(&htab->buckets[i].raw_lock); in htab_init_buckets() 144 lockdep_set_class(&htab->buckets[i].raw_lock, in htab_init_buckets() 145 &htab->lockdep_key); in htab_init_buckets() 150 static inline int htab_lock_bucket(const struct bpf_htab *htab, in htab_lock_bucket() argument 156 hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); in htab_lock_bucket() [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/ |
D | arena_htab.c | 16 static void test_arena_htab_common(struct htab *htab) in test_arena_htab_common() argument 20 printf("htab %p buckets %p n_buckets %d\n", htab, htab->buckets, htab->n_buckets); in test_arena_htab_common() 21 ASSERT_OK_PTR(htab->buckets, "htab->buckets shouldn't be NULL"); in test_arena_htab_common() 22 for (i = 0; htab->buckets && i < 16; i += 4) { in test_arena_htab_common() 27 int val = htab_lookup_elem(htab, i); in test_arena_htab_common() 37 struct htab *htab; in test_arena_htab_llvm() local 59 htab = skel->bss->htab_for_user; in test_arena_htab_llvm() 60 test_arena_htab_common(htab); in test_arena_htab_llvm() 69 struct htab *htab; in test_arena_htab_asm() local 79 htab = skel->bss->htab_for_user; in test_arena_htab_asm() [all …]
|
D | htab_update.c | 39 err = bpf_map_update_elem(bpf_map__fd(skel->maps.htab), &key, &value, 0); in test_reenter_update() 86 ctx.fd = bpf_map__fd(skel->maps.htab); in test_concurrent_update()
|
D | htab_reuse.c | 74 ctx.fd = bpf_map__fd(skel->maps.htab); in test_htab_reuse()
|
/linux-6.12.1/tools/testing/selftests/bpf/ |
D | bpf_arena_htab.h | 13 struct htab { struct 17 typedef struct htab __arena htab_t; argument 19 static inline htab_bucket_t *__select_bucket(htab_t *htab, __u32 hash) in __select_bucket() argument 21 htab_bucket_t *b = htab->buckets; in __select_bucket() 24 return &b[hash & (htab->n_buckets - 1)]; in __select_bucket() 27 static inline arena_list_head_t *select_bucket(htab_t *htab, __u32 hash) in select_bucket() argument 29 return &__select_bucket(htab, hash)->head; in select_bucket() 56 __weak int htab_lookup_elem(htab_t *htab __arg_arena, int key) in htab_lookup_elem() 61 cast_kern(htab); in htab_lookup_elem() 62 head = select_bucket(htab, key); in htab_lookup_elem() [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/progs/ |
D | arena_htab.c | 29 struct htab __arena *htab; in arena_htab_llvm() local 33 htab = bpf_alloc(sizeof(*htab)); in arena_htab_llvm() 34 cast_kern(htab); in arena_htab_llvm() 35 htab_init(htab); in arena_htab_llvm() 41 htab_update_elem(htab, i, i); in arena_htab_llvm() 47 htab_update_elem(htab, i, i); in arena_htab_llvm() 51 cast_user(htab); in arena_htab_llvm() 52 htab_for_user = htab; in arena_htab_llvm()
|
D | htab_mem_bench.c | 21 } htab SEC(".maps"); 31 bpf_map_update_elem(&htab, &ctx->from, zeroed_value, flags); in write_htab() 49 bpf_map_delete_elem(&htab, &ctx->from); in del_htab()
|
D | htab_update.c | 14 } htab SEC(".maps"); 27 update_err = bpf_map_update_elem(&htab, &key, &value, 0); in lookup_elem_raw()
|
D | htab_reuse.c | 19 } htab SEC(".maps");
|
/linux-6.12.1/net/core/ |
D | sock_map.c | 866 static struct bpf_shtab_bucket *sock_hash_select_bucket(struct bpf_shtab *htab, in sock_hash_select_bucket() argument 869 return &htab->buckets[hash & (htab->buckets_num - 1)]; in sock_hash_select_bucket() 889 struct bpf_shtab *htab = container_of(map, struct bpf_shtab, map); in __sock_hash_lookup_elem() local 897 bucket = sock_hash_select_bucket(htab, hash); in __sock_hash_lookup_elem() 903 static void sock_hash_free_elem(struct bpf_shtab *htab, in sock_hash_free_elem() argument 906 atomic_dec(&htab->count); in sock_hash_free_elem() 913 struct bpf_shtab *htab = container_of(map, struct bpf_shtab, map); in sock_hash_delete_from_link() local 918 bucket = sock_hash_select_bucket(htab, elem->hash); in sock_hash_delete_from_link() 930 sock_hash_free_elem(htab, elem); in sock_hash_delete_from_link() 937 struct bpf_shtab *htab = container_of(map, struct bpf_shtab, map); in sock_hash_delete_elem() local [all …]
|
/linux-6.12.1/tools/testing/selftests/net/ |
D | sample_map_ret0.bpf.c | 10 } htab SEC(".maps"); 26 value = bpf_map_lookup_elem(&htab, &key); in func()
|
D | bpf_offload.py | 1147 htab = maps[0] if maps[0]["type"] == "hash" else maps[1] variable 1209 bpftool("map delete id %d key %s" % (htab["id"], int2str("I", i))) 1214 (htab["id"], int2str("I", i)), fail=False)
|
/linux-6.12.1/drivers/s390/char/ |
D | sclp_rw.c | 41 sclp_make_buffer(void *page, unsigned short columns, unsigned short htab) in sclp_make_buffer() argument 59 buffer->htab = htab; in sclp_make_buffer() 235 } while (buffer->current_length % buffer->htab); in sclp_write()
|
D | sclp_rw.h | 75 unsigned short htab; member
|
/linux-6.12.1/arch/powerpc/kvm/ |
D | book3s_32_mmu_host.c | 46 static ulong htab; variable 110 ulong pteg = htab; in kvmppc_mmu_get_pteg() 123 htab, hash, htabmask, pteg); in kvmppc_mmu_get_pteg() 380 htab = (ulong)__va(sdr1 & 0xffff0000); in kvmppc_mmu_init_pr()
|
/linux-6.12.1/arch/powerpc/platforms/ps3/ |
D | Makefile | 2 obj-y += setup.o mm.o time.o hvcall.o htab.o repository.o
|
/linux-6.12.1/net/xfrm/ |
D | xfrm_policy.c | 4205 struct xfrm_policy_hash *htab; in xfrm_policy_init() local 4210 htab = &net->xfrm.policy_bydst[dir]; in xfrm_policy_init() 4211 htab->table = xfrm_hash_alloc(sz); in xfrm_policy_init() 4212 if (!htab->table) in xfrm_policy_init() 4214 htab->hmask = hmask; in xfrm_policy_init() 4215 htab->dbits4 = 32; in xfrm_policy_init() 4216 htab->sbits4 = 32; in xfrm_policy_init() 4217 htab->dbits6 = 128; in xfrm_policy_init() 4218 htab->sbits6 = 128; in xfrm_policy_init() 4235 struct xfrm_policy_hash *htab; in xfrm_policy_init() local [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/benchs/ |
D | bench_htab_mem.c | 180 map = ctx.skel->maps.htab; in htab_mem_setup()
|