/kernel/linux/linux-6.6/kernel/bpf/ |
H A D | stackmap.c | 30 u32 n_buckets; member 74 u64 cost, n_buckets; in stack_map_alloc() local 100 n_buckets = roundup_pow_of_two(attr->max_entries); in stack_map_alloc() 102 cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); in stack_map_alloc() 108 smap->n_buckets = n_buckets; in stack_map_alloc() 232 id = hash & (smap->n_buckets - 1); in __bpf_get_stackid() 584 if (unlikely(id >= smap->n_buckets)) in bpf_stackmap_copy() 614 if (id >= smap->n_buckets || !smap->buckets[id]) in stack_map_get_next_key() 620 while (id < smap->n_buckets in stack_map_get_next_key() 670 u64 n_buckets = smap->n_buckets; stack_map_mem_usage() local [all...] |
H A D | hashtab.c | 103 u32 n_buckets; /* number of hash buckets */ member 140 for (i = 0; i < htab->n_buckets; i++) { in htab_init_buckets() 155 hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); in htab_lock_bucket() 176 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() 518 if (htab->n_buckets > U32_MAX / sizeof(struct bucket)) in htab_map_alloc() 526 htab->buckets = bpf_map_area_alloc(htab->n_buckets * in htab_map_alloc() 625 return &htab->buckets[hash & (htab->n_buckets - 1)]; in __select_bucket() 653 u32 key_size, u32 n_buckets) in lookup_nulls_elem_raw() 663 if (unlikely(get_nulls_value(n) != (hash & (n_buckets in lookup_nulls_elem_raw() 651 lookup_nulls_elem_raw(struct hlist_nulls_head *head, u32 hash, void *key, u32 key_size, u32 n_buckets) lookup_nulls_elem_raw() argument [all...] |
H A D | devmap.c | 83 u32 n_buckets; member 107 return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; in dev_map_index_hash() 139 dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); in dev_map_init_map() 141 dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets, in dev_map_init_map() 206 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_free() 304 i = idx & (dtab->n_buckets - 1); in dev_map_hash_get_next_key() 308 for (; i < dtab->n_buckets; i++) { in dev_map_hash_get_next_key() 631 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_enqueue_multi() 750 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_redirect_multi() 1025 usage += (u64)dtab->n_buckets * sizeo in dev_map_mem_usage() [all...] |
/kernel/linux/linux-5.10/kernel/bpf/ |
H A D | stackmap.c | 31 u32 n_buckets; member 95 u64 cost, n_buckets; in stack_map_alloc() local 124 n_buckets = roundup_pow_of_two(attr->max_entries); in stack_map_alloc() 126 cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); in stack_map_alloc() 140 smap->n_buckets = n_buckets; in stack_map_alloc() 419 id = hash & (smap->n_buckets - 1); in __bpf_get_stackid() 773 if (unlikely(id >= smap->n_buckets)) in bpf_stackmap_copy() 803 if (id >= smap->n_buckets || !smap->buckets[id]) in stack_map_get_next_key() 809 while (id < smap->n_buckets in stack_map_get_next_key() [all...] |
H A D | hashtab.c | 99 u32 n_buckets; /* number of hash buckets */ member 139 for (i = 0; i < htab->n_buckets; i++) { in htab_init_buckets() 453 htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); in htab_map_alloc() 463 if (htab->n_buckets > U32_MAX / sizeof(struct bucket)) in htab_map_alloc() 466 cost = (u64) htab->n_buckets * sizeof(struct bucket) + in htab_map_alloc() 481 htab->buckets = bpf_map_area_alloc(htab->n_buckets * in htab_map_alloc() 529 return &htab->buckets[hash & (htab->n_buckets - 1)]; in __select_bucket() 557 u32 key_size, u32 n_buckets) in lookup_nulls_elem_raw() 567 if (unlikely(get_nulls_value(n) != (hash & (n_buckets - 1)))) in lookup_nulls_elem_raw() 593 l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); in __htab_map_lookup_elem() 555 lookup_nulls_elem_raw(struct hlist_nulls_head *head, u32 hash, void *key, u32 key_size, u32 n_buckets) lookup_nulls_elem_raw() argument [all...] |
H A D | devmap.c | 82 u32 n_buckets; member 106 return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; in dev_map_index_hash() 140 dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); in dev_map_init_map() 141 cost += (u64) sizeof(struct hlist_head) * dtab->n_buckets; in dev_map_init_map() 152 dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets, in dev_map_init_map() 224 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_free() 318 i = idx & (dtab->n_buckets - 1); in dev_map_hash_get_next_key() 322 for (; i < dtab->n_buckets; i++) { in dev_map_hash_get_next_key() 789 for (i = 0; i < dtab->n_buckets; i++) { in dev_map_hash_remove_netdev()
|
/kernel/linux/linux-5.10/drivers/net/wireless/broadcom/brcm80211/brcmfmac/ |
H A D | pno.c | 400 int err, n_buckets; in brcmf_pno_config_sched_scans() local 403 n_buckets = brcmf_pno_prep_fwconfig(pi, &pno_cfg, &buckets, in brcmf_pno_config_sched_scans() 405 if (n_buckets < 0) in brcmf_pno_config_sched_scans() 406 return n_buckets; in brcmf_pno_config_sched_scans() 408 gsz = sizeof(*gscan_cfg) + (n_buckets - 1) * sizeof(*buckets); in brcmf_pno_config_sched_scans() 436 gscan_cfg->count_of_channel_buckets = n_buckets; in brcmf_pno_config_sched_scans() 438 n_buckets * sizeof(*buckets)); in brcmf_pno_config_sched_scans()
|
/kernel/linux/linux-6.6/drivers/net/wireless/broadcom/brcm80211/brcmfmac/ |
H A D | pno.c | 400 int err, n_buckets; in brcmf_pno_config_sched_scans() local 403 n_buckets = brcmf_pno_prep_fwconfig(pi, &pno_cfg, &buckets, in brcmf_pno_config_sched_scans() 405 if (n_buckets < 0) in brcmf_pno_config_sched_scans() 406 return n_buckets; in brcmf_pno_config_sched_scans() 408 gsz = struct_size(gscan_cfg, bucket, n_buckets); in brcmf_pno_config_sched_scans() 436 gscan_cfg->count_of_channel_buckets = n_buckets; in brcmf_pno_config_sched_scans() 438 array_size(n_buckets, sizeof(*buckets))); in brcmf_pno_config_sched_scans()
|
/kernel/linux/linux-5.10/net/openvswitch/ |
H A D | flow_table.c | 169 ti->n_buckets = new_size; in table_instance_alloc() 484 for (i = 0; i < ti->n_buckets; i++) { in table_instance_flow_flush() 536 while (*bucket < ti->n_buckets) { in ovs_flow_tbl_dump_next() 557 return &ti->buckets[hash & (ti->n_buckets - 1)]; in find_bucket() 588 for (i = 0; i < old->n_buckets; i++) { in flow_table_copy_flows() 606 int n_buckets, bool ufid) in table_instance_rehash() 610 new_ti = table_instance_alloc(n_buckets); in table_instance_rehash() 954 return table_instance_rehash(ti, ti->n_buckets * 2, ufid); in table_instance_expand() 1048 if (table->count > ti->n_buckets) in flow_key_insert() 1051 new_ti = table_instance_rehash(ti, ti->n_buckets, fals in flow_key_insert() 605 table_instance_rehash(struct table_instance *ti, int n_buckets, bool ufid) table_instance_rehash() argument [all...] |
H A D | flow_table.h | 56 unsigned int n_buckets; member
|
/kernel/linux/linux-6.6/net/openvswitch/ |
H A D | flow_table.c | 170 ti->n_buckets = new_size; in table_instance_alloc() 485 for (i = 0; i < ti->n_buckets; i++) { in table_instance_flow_flush() 537 while (*bucket < ti->n_buckets) { in ovs_flow_tbl_dump_next() 558 return &ti->buckets[hash & (ti->n_buckets - 1)]; in find_bucket() 589 for (i = 0; i < old->n_buckets; i++) { in flow_table_copy_flows() 607 int n_buckets, bool ufid) in table_instance_rehash() 611 new_ti = table_instance_alloc(n_buckets); in table_instance_rehash() 955 return table_instance_rehash(ti, ti->n_buckets * 2, ufid); in table_instance_expand() 1049 if (table->count > ti->n_buckets) in flow_key_insert() 1052 new_ti = table_instance_rehash(ti, ti->n_buckets, fals in flow_key_insert() 606 table_instance_rehash(struct table_instance *ti, int n_buckets, bool ufid) table_instance_rehash() argument [all...] |
H A D | flow_table.h | 56 unsigned int n_buckets; member
|
/kernel/linux/linux-5.10/net/core/ |
H A D | bpf_sk_storage.c | 668 u32 i, count, n_buckets; in __acquires() local 672 n_buckets = 1U << smap->bucket_log; in __acquires() 673 if (bucket_id >= n_buckets) in __acquires()
|
/kernel/linux/linux-6.6/net/core/ |
H A D | bpf_sk_storage.c | 717 u32 i, count, n_buckets; in __acquires() local 721 n_buckets = 1U << smap->bucket_log; in __acquires() 722 if (bucket_id >= n_buckets) in __acquires()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
H A D | map_ptr_kern.c | 100 __u32 n_buckets; member 120 VERIFY(hash->n_buckets == MAX_ENTRIES); in check_hash()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/ |
H A D | map_ptr_kern.c | 94 __u32 n_buckets; member 116 VERIFY(hash->n_buckets == MAX_ENTRIES); in check_hash()
|