Home
last modified time | relevance | path

Searched refs:n_buckets (Results 1 – 3 of 3) sorted by relevance

/kernel/bpf/
Dstackmap.c30 u32 n_buckets; member
93 u64 cost, n_buckets; in stack_map_alloc() local
117 n_buckets = roundup_pow_of_two(attr->max_entries); in stack_map_alloc()
118 if (!n_buckets) in stack_map_alloc()
121 cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); in stack_map_alloc()
128 smap->n_buckets = n_buckets; in stack_map_alloc()
276 id = hash & (smap->n_buckets - 1); in __bpf_get_stackid()
628 if (unlikely(id >= smap->n_buckets)) in bpf_stackmap_copy()
658 if (id >= smap->n_buckets || !smap->buckets[id]) in stack_map_get_next_key()
664 while (id < smap->n_buckets && !smap->buckets[id]) in stack_map_get_next_key()
[all …]
Dhashtab.c102 u32 n_buckets; /* number of hash buckets */ member
144 for (i = 0; i < htab->n_buckets; i++) { in htab_init_buckets()
166 hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); in htab_lock_bucket()
197 hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); in htab_unlock_bucket()
508 htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); in htab_map_alloc()
519 if (htab->n_buckets == 0 || in htab_map_alloc()
520 htab->n_buckets > U32_MAX / sizeof(struct bucket)) in htab_map_alloc()
524 htab->buckets = bpf_map_area_alloc(htab->n_buckets * in htab_map_alloc()
582 return &htab->buckets[hash & (htab->n_buckets - 1)]; in __select_bucket()
610 u32 key_size, u32 n_buckets) in lookup_nulls_elem_raw() argument
[all …]
Ddevmap.c83 u32 n_buckets; member
107 return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; in dev_map_index_hash()
133 dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); in dev_map_init_map()
135 if (!dtab->n_buckets) /* Overflow check */ in dev_map_init_map()
140 dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets, in dev_map_init_map()
208 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_free()
306 i = idx & (dtab->n_buckets - 1); in dev_map_hash_get_next_key()
310 for (; i < dtab->n_buckets; i++) { in dev_map_hash_get_next_key()
633 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_enqueue_multi()
752 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_redirect_multi()
[all …]