/openbmc/qemu/util/ |
H A D | throttle.c | 36 void throttle_leak_bucket(LeakyBucket *bkt, int64_t delta_ns) in throttle_leak_bucket() argument 41 leak = (bkt->avg * (double) delta_ns) / NANOSECONDS_PER_SECOND; in throttle_leak_bucket() 44 bkt->level = MAX(bkt->level - leak, 0); in throttle_leak_bucket() 49 if (bkt->burst_length > 1) { in throttle_leak_bucket() 50 leak = (bkt->max * (double) delta_ns) / NANOSECONDS_PER_SECOND; in throttle_leak_bucket() 51 bkt->burst_level = MAX(bkt->burst_level - leak, 0); in throttle_leak_bucket() 95 int64_t throttle_compute_wait(LeakyBucket *bkt) in throttle_compute_wait() argument 101 if (!bkt->avg) { in throttle_compute_wait() 105 if (!bkt->max) { in throttle_compute_wait() 109 bucket_size = (double) bkt->avg / 10; in throttle_compute_wait() [all …]
|
/openbmc/qemu/tests/unit/ |
H A D | test-throttle.c | 27 static LeakyBucket bkt; variable 43 bkt = cfg.buckets[THROTTLE_BPS_TOTAL]; in test_leak_bucket() 46 bkt.avg = 150; in test_leak_bucket() 47 bkt.max = 15; in test_leak_bucket() 48 bkt.level = 1.5; in test_leak_bucket() 51 throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150); in test_leak_bucket() 52 g_assert(bkt.avg == 150); in test_leak_bucket() 53 g_assert(bkt.max == 15); in test_leak_bucket() 54 g_assert(double_cmp(bkt.level, 0.5)); in test_leak_bucket() 57 throttle_leak_bucket(&bkt, NANOSECONDS_PER_SECOND / 150); in test_leak_bucket() [all …]
|
/openbmc/linux/include/linux/ |
H A D | hashtable.h | 126 #define hash_for_each(name, bkt, obj, member) \ argument 127 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 128 (bkt)++)\ 129 hlist_for_each_entry(obj, &name[bkt], member) 138 #define hash_for_each_rcu(name, bkt, obj, member) \ argument 139 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 140 (bkt)++)\ 141 hlist_for_each_entry_rcu(obj, &name[bkt], member) 152 #define hash_for_each_safe(name, bkt, tmp, obj, member) \ argument 153 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ [all …]
|
H A D | rhashtable.h | 327 struct rhash_lock_head __rcu **bkt) in rht_lock() argument 332 bit_spin_lock(0, (unsigned long *)bkt); in rht_lock() 350 struct rhash_lock_head __rcu **bkt, in rht_unlock() argument 354 bit_spin_unlock(0, (unsigned long *)bkt); in rht_unlock() 359 struct rhash_lock_head *p, struct rhash_lock_head __rcu *const *bkt) in __rht_ptr() argument 363 (unsigned long)RHT_NULLS_MARKER(bkt)); in __rht_ptr() 374 struct rhash_lock_head __rcu *const *bkt) in rht_ptr_rcu() argument 376 return __rht_ptr(rcu_dereference(*bkt), bkt); in rht_ptr_rcu() 380 struct rhash_lock_head __rcu *const *bkt, in rht_ptr() argument 384 return __rht_ptr(rht_dereference_bucket(*bkt, tbl, hash), bkt); in rht_ptr() [all …]
|
/openbmc/linux/tools/include/linux/ |
H A D | hashtable.h | 105 #define hash_for_each(name, bkt, obj, member) \ argument 106 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 107 (bkt)++)\ 108 hlist_for_each_entry(obj, &name[bkt], member) 119 #define hash_for_each_safe(name, bkt, tmp, obj, member) \ argument 120 for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ 121 (bkt)++)\ 122 hlist_for_each_entry_safe(obj, tmp, &name[bkt], member)
|
/openbmc/linux/tools/lib/bpf/ |
H A D | hashmap.h | 168 #define hashmap__for_each_entry(map, cur, bkt) \ argument 169 for (bkt = 0; bkt < map->cap; bkt++) \ 170 for (cur = map->buckets[bkt]; cur; cur = cur->next) 180 #define hashmap__for_each_entry_safe(map, cur, tmp, bkt) \ argument 181 for (bkt = 0; bkt < map->cap; bkt++) \ 182 for (cur = map->buckets[bkt]; \
|
H A D | hashmap.c | 66 size_t bkt; in hashmap__clear() local 68 hashmap__for_each_entry_safe(map, cur, tmp, bkt) { in hashmap__clear() 106 size_t h, bkt; in hashmap_grow() local 117 hashmap__for_each_entry_safe(map, cur, tmp, bkt) { in hashmap_grow()
|
/openbmc/linux/tools/perf/util/ |
H A D | hashmap.h | 168 #define hashmap__for_each_entry(map, cur, bkt) \ argument 169 for (bkt = 0; bkt < map->cap; bkt++) \ 170 for (cur = map->buckets[bkt]; cur; cur = cur->next) 180 #define hashmap__for_each_entry_safe(map, cur, tmp, bkt) \ argument 181 for (bkt = 0; bkt < map->cap; bkt++) \ 182 for (cur = map->buckets[bkt]; \
|
H A D | expr.c | 86 size_t bkt; in ids__free() local 91 hashmap__for_each_entry(ids, cur, bkt) { in ids__free() 115 size_t bkt; in ids__union() local 133 hashmap__for_each_entry(ids2, cur, bkt) { in ids__union() 232 size_t bkt; in expr__subset_of_ids() local 235 hashmap__for_each_entry(needles->ids, cur, bkt) { in expr__subset_of_ids() 311 size_t bkt; in expr__ctx_clear() local 313 hashmap__for_each_entry(ctx->ids, cur, bkt) { in expr__ctx_clear() 323 size_t bkt; in expr__ctx_free() local 329 hashmap__for_each_entry(ctx->ids, cur, bkt) { in expr__ctx_free()
|
H A D | hashmap.c | 66 size_t bkt; in hashmap__clear() local 68 hashmap__for_each_entry_safe(map, cur, tmp, bkt) { in hashmap__clear() 106 size_t h, bkt; in hashmap_grow() local 117 hashmap__for_each_entry_safe(map, cur, tmp, bkt) { in hashmap_grow()
|
/openbmc/linux/drivers/infiniband/ulp/opa_vnic/ |
H A D | opa_vnic_internal.h | 280 #define vnic_hash_for_each_safe(name, bkt, tmp, obj, member) \ argument 281 for ((bkt) = 0, obj = NULL; \ 282 !obj && (bkt) < OPA_VNIC_MAC_TBL_SIZE; (bkt)++) \ 283 hlist_for_each_entry_safe(obj, tmp, &name[bkt], member) 289 #define vnic_hash_for_each(name, bkt, obj, member) \ argument 290 for ((bkt) = 0, obj = NULL; \ 291 !obj && (bkt) < OPA_VNIC_MAC_TBL_SIZE; (bkt)++) \ 292 hlist_for_each_entry(obj, &name[bkt], member)
|
H A D | opa_vnic_encap.c | 107 int bkt; in opa_vnic_free_mac_tbl() local 112 vnic_hash_for_each_safe(mactbl, bkt, tmp, node, hlist) { in opa_vnic_free_mac_tbl() 157 int bkt; in opa_vnic_query_mac_tbl() local 168 vnic_hash_for_each(mactbl, bkt, node, hlist) { in opa_vnic_query_mac_tbl() 209 int i, bkt, rc = 0; in opa_vnic_update_mac_tbl() local 263 vnic_hash_for_each(old_mactbl, bkt, node, hlist) { in opa_vnic_update_mac_tbl()
|
/openbmc/linux/lib/ |
H A D | hashtable_test.c | 68 int bkt; in hashtable_test_hash_add() local 80 hash_for_each(hash, bkt, x, node) { in hashtable_test_hash_add() 127 int bkt, i, j, count; in hashtable_test_hash_for_each() local 139 hash_for_each(hash, bkt, x, node) { in hashtable_test_hash_for_each() 157 int bkt, i, j, count; in hashtable_test_hash_for_each_safe() local 169 hash_for_each_safe(hash, bkt, tmp, x, node) { in hashtable_test_hash_for_each_safe() 190 int bkt, i, j, count; in hashtable_test_hash_for_each_possible() local 220 hash_for_each(hash, bkt, y, node) { in hashtable_test_hash_for_each_possible() 223 buckets[y->key] = bkt; in hashtable_test_hash_for_each_possible() 245 int bkt, i, j, count; in hashtable_test_hash_for_each_possible_safe() local [all …]
|
H A D | rhashtable.c | 225 struct rhash_lock_head __rcu **bkt, in rhashtable_rehash_one() argument 241 rht_for_each_from(entry, rht_ptr(bkt, old_tbl, old_hash), in rhashtable_rehash_one() 270 rht_assign_locked(bkt, next); in rhashtable_rehash_one() 280 struct rhash_lock_head __rcu **bkt = rht_bucket_var(old_tbl, old_hash); in rhashtable_rehash_chain() local 284 if (!bkt) in rhashtable_rehash_chain() 286 flags = rht_lock(old_tbl, bkt); in rhashtable_rehash_chain() 288 while (!(err = rhashtable_rehash_one(ht, bkt, old_hash))) in rhashtable_rehash_chain() 293 rht_unlock(old_tbl, bkt, flags); in rhashtable_rehash_chain() 491 struct rhash_lock_head __rcu **bkt, in rhashtable_lookup_one() argument 504 rht_for_each_from(head, rht_ptr(bkt, tbl, hash), tbl, hash) { in rhashtable_lookup_one() [all …]
|
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | hashmap.c | 47 int err, bkt, found_cnt, i; in test_hashmap_generic() local 92 hashmap__for_each_entry(map, entry, bkt) { in test_hashmap_generic() 140 hashmap__for_each_entry_safe(map, entry, tmp, bkt) { in test_hashmap_generic() 197 hashmap__for_each_entry_safe(map, entry, tmp, bkt) { in test_hashmap_generic() 230 hashmap__for_each_entry(map, entry, bkt) { in test_hashmap_generic() 238 hashmap__for_each_entry(map, entry, bkt) { in test_hashmap_generic() 265 int err, i, bkt; in test_hashmap_ptr_iface() local 319 hashmap__for_each_entry(map, cur, bkt) { in test_hashmap_ptr_iface() 345 int err, bkt; in test_hashmap_multimap() local 382 hashmap__for_each_entry(map, entry, bkt) { in test_hashmap_multimap() [all …]
|
/openbmc/linux/drivers/net/ethernet/intel/ice/ |
H A D | ice_eswitch.c | 198 unsigned int bkt; in ice_eswitch_release_reprs() local 202 ice_for_each_vf(pf, bkt, vf) { in ice_eswitch_release_reprs() 229 unsigned int bkt; in ice_eswitch_setup_reprs() local 233 ice_for_each_vf(pf, bkt, vf) { in ice_eswitch_setup_reprs() 279 ice_for_each_vf(pf, bkt, vf) { in ice_eswitch_setup_reprs() 433 unsigned int bkt; in ice_eswitch_napi_del() local 437 ice_for_each_vf(pf, bkt, vf) in ice_eswitch_napi_del() 448 unsigned int bkt; in ice_eswitch_napi_enable() local 452 ice_for_each_vf(pf, bkt, vf) in ice_eswitch_napi_enable() 463 unsigned int bkt; in ice_eswitch_napi_disable() local [all …]
|
H A D | ice_vf_lib.h | 190 #define ice_for_each_vf(pf, bkt, vf) \ argument 191 hash_for_each((pf)->vfs.table, (bkt), (vf), entry) 207 #define ice_for_each_vf_rcu(pf, bkt, vf) \ argument 208 hash_for_each_rcu((pf)->vfs.table, (bkt), (vf), entry)
|
H A D | ice_sriov.c | 29 unsigned int bkt; in ice_free_vf_entries() local 37 hash_for_each_safe(vfs->table, bkt, tmp, vf, entry) { in ice_free_vf_entries() 157 unsigned int bkt; in ice_free_vfs() local 178 ice_for_each_vf(pf, bkt, vf) { in ice_free_vfs() 564 unsigned int bkt, it_cnt; in ice_start_vfs() local 571 ice_for_each_vf(pf, bkt, vf) { in ice_start_vfs() 591 ice_for_each_vf(pf, bkt, vf) { in ice_start_vfs() 1004 unsigned int bkt; in ice_process_vflr_event() local 1012 ice_for_each_vf(pf, bkt, vf) { in ice_process_vflr_event() 1041 unsigned int bkt; in ice_get_vf_from_pfq() local [all …]
|
H A D | ice_vf_lib.c | 106 unsigned int bkt; in ice_get_num_vfs() local 110 ice_for_each_vf_rcu(pf, bkt, vf) in ice_get_num_vfs() 564 unsigned int bkt; in ice_is_any_vf_in_unicast_promisc() local 567 ice_for_each_vf_rcu(pf, bkt, vf) { in ice_is_any_vf_in_unicast_promisc() 737 unsigned int bkt; in ice_reset_all_vfs() local 746 ice_for_each_vf(pf, bkt, vf) in ice_reset_all_vfs() 756 ice_for_each_vf(pf, bkt, vf) in ice_reset_all_vfs() 763 ice_for_each_vf(pf, bkt, vf) { in ice_reset_all_vfs() 775 ice_for_each_vf(pf, bkt, vf) { in ice_reset_all_vfs() 1375 unsigned int bkt; in ice_get_vf_ctrl_vsi() local [all …]
|
H A D | ice_repr.c | 380 unsigned int bkt; in ice_repr_rem_from_all_vfs() local 384 ice_for_each_vf(pf, bkt, vf) in ice_repr_rem_from_all_vfs() 404 unsigned int bkt; in ice_repr_add_for_all_vfs() local 409 ice_for_each_vf(pf, bkt, vf) { in ice_repr_add_for_all_vfs()
|
/openbmc/linux/drivers/s390/crypto/ |
H A D | ap_card.c | 80 int bkt; in request_count_store() local 85 hash_for_each(ap_queues, bkt, aq, hnode) in request_count_store() 99 int bkt; in requestq_count_show() local 106 hash_for_each(ap_queues, bkt, aq, hnode) in requestq_count_show() 118 int bkt; in pendingq_count_show() local 125 hash_for_each(ap_queues, bkt, aq, hnode) in pendingq_count_show()
|
/openbmc/linux/net/ipv6/ |
H A D | calipso.c | 203 u32 bkt; in calipso_cache_check() local 212 bkt = hash & (CALIPSO_CACHE_BUCKETS - 1); in calipso_cache_check() 213 spin_lock_bh(&calipso_cache[bkt].lock); in calipso_cache_check() 214 list_for_each_entry(entry, &calipso_cache[bkt].list, list) { in calipso_cache_check() 224 spin_unlock_bh(&calipso_cache[bkt].lock); in calipso_cache_check() 239 spin_unlock_bh(&calipso_cache[bkt].lock); in calipso_cache_check() 244 spin_unlock_bh(&calipso_cache[bkt].lock); in calipso_cache_check() 268 u32 bkt; in calipso_cache_add() local 291 bkt = entry->hash & (CALIPSO_CACHE_BUCKETS - 1); in calipso_cache_add() 292 spin_lock_bh(&calipso_cache[bkt].lock); in calipso_cache_add() [all …]
|
/openbmc/openbmc/poky/meta/classes/ |
H A D | ccmake.bbclass | 51 for bk, bkt, bv in b: 54 if bkt != akt or bv != av: # changed 56 added.append((bk, bkt, bv)) 63 for bk, bkt, bv in b: 65 added.append((bk, bkt, bv))
|
/openbmc/linux/net/ipv4/ |
H A D | cipso_ipv4.c | 237 u32 bkt; in cipso_v4_cache_check() local 246 bkt = hash & (CIPSO_V4_CACHE_BUCKETS - 1); in cipso_v4_cache_check() 247 spin_lock_bh(&cipso_v4_cache[bkt].lock); in cipso_v4_cache_check() 248 list_for_each_entry(entry, &cipso_v4_cache[bkt].list, list) { in cipso_v4_cache_check() 258 spin_unlock_bh(&cipso_v4_cache[bkt].lock); in cipso_v4_cache_check() 273 spin_unlock_bh(&cipso_v4_cache[bkt].lock); in cipso_v4_cache_check() 278 spin_unlock_bh(&cipso_v4_cache[bkt].lock); in cipso_v4_cache_check() 301 u32 bkt; in cipso_v4_cache_add() local 324 bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1); in cipso_v4_cache_add() 325 spin_lock_bh(&cipso_v4_cache[bkt].lock); in cipso_v4_cache_add() [all …]
|
/openbmc/qemu/include/qemu/ |
H A D | throttle.h | 118 void throttle_leak_bucket(LeakyBucket *bkt, int64_t delta); 120 int64_t throttle_compute_wait(LeakyBucket *bkt);
|