/net/batman-adv/ |
D | hash.c | 15 static void batadv_hash_init(struct batadv_hashtable *hash) in batadv_hash_init() argument 19 for (i = 0; i < hash->size; i++) { in batadv_hash_init() 20 INIT_HLIST_HEAD(&hash->table[i]); in batadv_hash_init() 21 spin_lock_init(&hash->list_locks[i]); in batadv_hash_init() 24 atomic_set(&hash->generation, 0); in batadv_hash_init() 31 void batadv_hash_destroy(struct batadv_hashtable *hash) in batadv_hash_destroy() argument 33 kfree(hash->list_locks); in batadv_hash_destroy() 34 kfree(hash->table); in batadv_hash_destroy() 35 kfree(hash); in batadv_hash_destroy() 46 struct batadv_hashtable *hash; in batadv_hash_new() local [all …]
|
D | hash.h | 58 void batadv_hash_set_lock_class(struct batadv_hashtable *hash, 62 void batadv_hash_destroy(struct batadv_hashtable *hash); 75 static inline int batadv_hash_add(struct batadv_hashtable *hash, in batadv_hash_add() argument 87 if (!hash) in batadv_hash_add() 90 index = choose(data, hash->size); in batadv_hash_add() 91 head = &hash->table[index]; in batadv_hash_add() 92 list_lock = &hash->list_locks[index]; in batadv_hash_add() 106 atomic_inc(&hash->generation); in batadv_hash_add() 129 static inline void *batadv_hash_remove(struct batadv_hashtable *hash, in batadv_hash_remove() argument 139 index = choose(data, hash->size); in batadv_hash_remove() [all …]
|
D | bridge_loop_avoidance.c | 70 u32 hash = 0; in batadv_choose_claim() local 72 hash = jhash(&claim->addr, sizeof(claim->addr), hash); in batadv_choose_claim() 73 hash = jhash(&claim->vid, sizeof(claim->vid), hash); in batadv_choose_claim() 75 return hash % size; in batadv_choose_claim() 88 u32 hash = 0; in batadv_choose_backbone_gw() local 91 hash = jhash(&gw->orig, sizeof(gw->orig), hash); in batadv_choose_backbone_gw() 92 hash = jhash(&gw->vid, sizeof(gw->vid), hash); in batadv_choose_backbone_gw() 94 return hash % size; in batadv_choose_backbone_gw() 222 struct batadv_hashtable *hash = bat_priv->bla.claim_hash; in batadv_claim_hash_find() local 228 if (!hash) in batadv_claim_hash_find() [all …]
|
D | distributed-arp-table.c | 168 if (!bat_priv->dat.hash) in __batadv_dat_purge() 171 for (i = 0; i < bat_priv->dat.hash->size; i++) { in __batadv_dat_purge() 172 head = &bat_priv->dat.hash->table[i]; in __batadv_dat_purge() 173 list_lock = &bat_priv->dat.hash->list_locks[i]; in __batadv_dat_purge() 289 u32 hash = 0; in batadv_hash_dat() local 297 hash += key[i]; in batadv_hash_dat() 298 hash += (hash << 10); in batadv_hash_dat() 299 hash ^= (hash >> 6); in batadv_hash_dat() 305 hash += key[i]; in batadv_hash_dat() 306 hash += (hash << 10); in batadv_hash_dat() [all …]
|
D | network-coding.c | 403 struct batadv_hashtable *hash = bat_priv->orig_hash; in batadv_nc_purge_orig_hash() local 408 if (!hash) in batadv_nc_purge_orig_hash() 412 for (i = 0; i < hash->size; i++) { in batadv_nc_purge_orig_hash() 413 head = &hash->table[i]; in batadv_nc_purge_orig_hash() 434 struct batadv_hashtable *hash, in batadv_nc_purge_paths() argument 444 for (i = 0; i < hash->size; i++) { in batadv_nc_purge_paths() 445 head = &hash->table[i]; in batadv_nc_purge_paths() 446 lock = &hash->list_locks[i]; in batadv_nc_purge_paths() 505 u32 hash = 0; in batadv_nc_hash_choose() local 507 hash = jhash(&nc_path->prev_hop, sizeof(nc_path->prev_hop), hash); in batadv_nc_hash_choose() [all …]
|
D | translation-table.c | 108 u32 hash = 0; in batadv_choose_tt() local 111 hash = jhash(&tt->addr, ETH_ALEN, hash); in batadv_choose_tt() 112 hash = jhash(&tt->vid, sizeof(tt->vid), hash); in batadv_choose_tt() 114 return hash % size; in batadv_choose_tt() 127 batadv_tt_hash_find(struct batadv_hashtable *hash, const u8 *addr, in batadv_tt_hash_find() argument 134 if (!hash) in batadv_tt_hash_find() 140 index = batadv_choose_tt(&to_search, hash->size); in batadv_tt_hash_find() 141 head = &hash->table[index]; in batadv_tt_hash_find() 1074 struct batadv_hashtable *hash = bat_priv->tt.local_hash; in batadv_tt_local_seq_print_text() local 1096 for (i = 0; i < hash->size; i++) { in batadv_tt_local_seq_print_text() [all …]
|
D | originator.h | 80 u32 hash = 0; in batadv_choose_orig() local 82 hash = jhash(data, ETH_ALEN, hash); in batadv_choose_orig() 83 return hash % size; in batadv_choose_orig()
|
/net/ceph/crush/ |
D | hash.c | 29 __u32 hash = crush_hash_seed ^ a; in crush_hash32_rjenkins1() local 33 crush_hashmix(b, x, hash); in crush_hash32_rjenkins1() 34 crush_hashmix(y, a, hash); in crush_hash32_rjenkins1() 35 return hash; in crush_hash32_rjenkins1() 40 __u32 hash = crush_hash_seed ^ a ^ b; in crush_hash32_rjenkins1_2() local 43 crush_hashmix(a, b, hash); in crush_hash32_rjenkins1_2() 44 crush_hashmix(x, a, hash); in crush_hash32_rjenkins1_2() 45 crush_hashmix(b, y, hash); in crush_hash32_rjenkins1_2() 46 return hash; in crush_hash32_rjenkins1_2() 51 __u32 hash = crush_hash_seed ^ a ^ b ^ c; in crush_hash32_rjenkins1_3() local [all …]
|
/net/ipv4/ |
D | tcp_metrics.c | 26 struct net *net, unsigned int hash); 166 unsigned int hash) in tcpm_new() argument 178 tm = __tcp_get_metrics(saddr, daddr, net, hash); in tcpm_new() 191 oldest = deref_locked(tcp_metrics_hash[hash].chain); in tcpm_new() 213 tm->tcpm_next = tcp_metrics_hash[hash].chain; in tcpm_new() 214 rcu_assign_pointer(tcp_metrics_hash[hash].chain, tm); in tcpm_new() 233 struct net *net, unsigned int hash) in __tcp_get_metrics() argument 238 for (tm = rcu_dereference(tcp_metrics_hash[hash].chain); tm; in __tcp_get_metrics() 254 unsigned int hash; in __tcp_get_metrics_req() local 263 hash = ipv4_addr_hash(inet_rsk(req)->ir_rmt_addr); in __tcp_get_metrics_req() [all …]
|
/net/netfilter/ipset/ |
D | Kconfig | 56 tristate "hash:ip set support" 59 This option adds the hash:ip set type support, by which one 66 tristate "hash:ip,mark set support" 69 This option adds the hash:ip,mark set type support, by which one 75 tristate "hash:ip,port set support" 78 This option adds the hash:ip,port set type support, by which one 84 tristate "hash:ip,port,ip set support" 87 This option adds the hash:ip,port,ip set type support, by which 94 tristate "hash:ip,port,net set support" 97 This option adds the hash:ip,port,net set type support, by which [all …]
|
/net/netfilter/ipvs/ |
D | ip_vs_proto.c | 51 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); in register_ip_vs_protocol() local 53 pp->next = ip_vs_proto_table[hash]; in register_ip_vs_protocol() 54 ip_vs_proto_table[hash] = pp; in register_ip_vs_protocol() 68 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); in register_ip_vs_proto_netns() local 76 pd->next = ipvs->proto_data_table[hash]; in register_ip_vs_proto_netns() 77 ipvs->proto_data_table[hash] = pd; in register_ip_vs_proto_netns() 84 ipvs->proto_data_table[hash] = pd->next; in register_ip_vs_proto_netns() 99 unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); in unregister_ip_vs_protocol() local 101 pp_p = &ip_vs_proto_table[hash]; in unregister_ip_vs_protocol() 121 unsigned int hash = IP_VS_PROTO_HASH(pd->pp->protocol); in unregister_ip_vs_proto_netns() local [all …]
|
D | ip_vs_conn.c | 165 unsigned int hash; in ip_vs_conn_hash() local 172 hash = ip_vs_conn_hashkey_conn(cp); in ip_vs_conn_hash() 174 ct_write_lock_bh(hash); in ip_vs_conn_hash() 180 hlist_add_head_rcu(&cp->c_list, &ip_vs_conn_tab[hash]); in ip_vs_conn_hash() 189 ct_write_unlock_bh(hash); in ip_vs_conn_hash() 201 unsigned int hash; in ip_vs_conn_unhash() local 205 hash = ip_vs_conn_hashkey_conn(cp); in ip_vs_conn_unhash() 207 ct_write_lock_bh(hash); in ip_vs_conn_unhash() 219 ct_write_unlock_bh(hash); in ip_vs_conn_unhash() 229 unsigned int hash; in ip_vs_conn_unlink() local [all …]
|
/net/netfilter/ |
D | nft_set_hash.c | 475 u32 hash; in nft_hash_lookup() local 477 hash = jhash(key, set->klen, priv->seed); in nft_hash_lookup() 478 hash = reciprocal_scale(hash, priv->buckets); in nft_hash_lookup() 479 hlist_for_each_entry_rcu(he, &priv->table[hash], node) { in nft_hash_lookup() 495 u32 hash; in nft_hash_get() local 497 hash = jhash(elem->key.val.data, set->klen, priv->seed); in nft_hash_get() 498 hash = reciprocal_scale(hash, priv->buckets); in nft_hash_get() 499 hlist_for_each_entry_rcu(he, &priv->table[hash], node) { in nft_hash_get() 514 u32 hash, k1, k2; in nft_hash_lookup_fast() local 517 hash = jhash_1word(k1, priv->seed); in nft_hash_lookup_fast() [all …]
|
D | xt_cluster.c | 42 u_int32_t hash = 0; in xt_cluster_hash() local 46 hash = xt_cluster_hash_ipv4(nf_ct_orig_ipv4_src(ct), info); in xt_cluster_hash() 49 hash = xt_cluster_hash_ipv6(nf_ct_orig_ipv6_src(ct), info); in xt_cluster_hash() 56 return reciprocal_scale(hash, info->total_nodes); in xt_cluster_hash() 85 unsigned long hash; in xt_cluster_mt() local 114 hash = xt_cluster_hash(ct->master, info); in xt_cluster_mt() 116 hash = xt_cluster_hash(ct, info); in xt_cluster_mt() 118 return !!((1 << hash) & info->node_mask) ^ in xt_cluster_mt()
|
D | nf_conntrack_core.c | 204 static u32 scale_hash(u32 hash) in scale_hash() argument 206 return reciprocal_scale(hash, nf_conntrack_htable_size); in scale_hash() 633 unsigned int hash, reply_hash; in nf_ct_delete_from_lists() local 641 hash = hash_conntrack(net, in nf_ct_delete_from_lists() 645 } while (nf_conntrack_double_lock(net, hash, reply_hash, sequence)); in nf_ct_delete_from_lists() 648 nf_conntrack_double_unlock(hash, reply_hash); in nf_ct_delete_from_lists() 736 const struct nf_conntrack_tuple *tuple, u32 hash) in ____nf_conntrack_find() argument 745 bucket = reciprocal_scale(hash, hsize); in ____nf_conntrack_find() 775 const struct nf_conntrack_tuple *tuple, u32 hash) in __nf_conntrack_find_get() argument 782 h = ____nf_conntrack_find(net, zone, tuple, hash); in __nf_conntrack_find_get() [all …]
|
/net/appletalk/ |
D | aarp.c | 413 int hash = sa->s_node % (AARP_HASH_SIZE - 1); in aarp_proxy_remove() local 418 a = __aarp_find_entry(proxies[hash], dev, sa); in aarp_proxy_remove() 429 int hash = sa->s_node % (AARP_HASH_SIZE - 1); in __aarp_proxy_find() local 430 struct aarp_entry *a = __aarp_find_entry(proxies[hash], dev, sa); in __aarp_proxy_find() 483 int hash, retval = -EPROTONOSUPPORT; in aarp_proxy_probe_network() local 512 hash = sa->s_node % (AARP_HASH_SIZE - 1); in aarp_proxy_probe_network() 513 entry->next = proxies[hash]; in aarp_proxy_probe_network() 514 proxies[hash] = entry; in aarp_proxy_probe_network() 547 int hash; in aarp_send_ddp() local 603 hash = sa->s_node % (AARP_HASH_SIZE - 1); in aarp_send_ddp() [all …]
|
/net/sunrpc/ |
D | cache.c | 61 int hash) in sunrpc_cache_find_rcu() argument 63 struct hlist_head *head = &detail->hash_table[hash]; in sunrpc_cache_find_rcu() 99 int hash) in sunrpc_cache_add_entry() argument 102 struct hlist_head *head = &detail->hash_table[hash]; in sunrpc_cache_add_entry() 145 struct cache_head *key, int hash) in sunrpc_cache_lookup_rcu() argument 149 ret = sunrpc_cache_find_rcu(detail, key, hash); in sunrpc_cache_lookup_rcu() 153 return sunrpc_cache_add_entry(detail, key, hash); in sunrpc_cache_lookup_rcu() 201 struct cache_head *new, struct cache_head *old, int hash) in sunrpc_cache_update() argument 231 hlist_add_head(&tmp->cache_list, &detail->hash_table[hash]); in sunrpc_cache_update() 585 hlist_del_init(&dreq->hash); in __unhash_deferred_req() [all …]
|
D | svcauth.c | 155 hlist_del_rcu(&dom->hash); in auth_domain_release() 176 hlist_for_each_entry(hp, head, hash) { in auth_domain_lookup() 184 hlist_add_head_rcu(&new->hash, head); in auth_domain_lookup() 198 hlist_for_each_entry_rcu(hp, head, hash) { in auth_domain_find() 229 hlist_for_each_entry(hp, &auth_domain_table[h], hash) in auth_domain_cleanup()
|
/net/openvswitch/ |
D | flow_table.c | 554 static struct hlist_head *find_bucket(struct table_instance *ti, u32 hash) in find_bucket() argument 556 hash = jhash_1word(hash, ti->hash_seed); in find_bucket() 557 return &ti->buckets[hash & (ti->n_buckets - 1)]; in find_bucket() 565 head = find_bucket(ti, flow->flow_table.hash); in table_instance_insert() 574 head = find_bucket(ti, flow->ufid_table.hash); in ufid_table_instance_insert() 707 u32 hash; in masked_flow_lookup() local 711 hash = flow_hash(&masked_key, &mask->range); in masked_flow_lookup() 712 head = find_bucket(ti, hash); in masked_flow_lookup() 717 if (flow->mask == mask && flow->flow_table.hash == hash && in masked_flow_lookup() 796 u32 hash; in ovs_flow_tbl_lookup_stats() local [all …]
|
/net/l2tp/ |
D | l2tp_core.c | 288 int hash; in l2tp_session_get_nth() local 293 for (hash = 0; hash < L2TP_HASH_SIZE; hash++) { in l2tp_session_get_nth() 294 hlist_for_each_entry(session, &tunnel->session_hlist[hash], hlist) { in l2tp_session_get_nth() 316 int hash; in l2tp_session_get_by_ifname() local 320 for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++) { in l2tp_session_get_by_ifname() 321 hlist_for_each_entry_rcu(session, &pn->l2tp_session_hlist[hash], global_hlist) { in l2tp_session_get_by_ifname() 1193 int hash; in l2tp_tunnel_closeall() local 1200 for (hash = 0; hash < L2TP_HASH_SIZE; hash++) { in l2tp_tunnel_closeall() 1202 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { in l2tp_tunnel_closeall() 1645 int hash; in l2tp_init_net() local [all …]
|
/net/core/ |
D | secure_seq.c | 90 u32 hash; in secure_tcpv6_seq() local 93 hash = siphash(&combined, offsetofend(typeof(combined), dport), in secure_tcpv6_seq() 95 return seq_scale(hash); in secure_tcpv6_seq() 139 u32 hash; in secure_tcp_seq() local 142 hash = siphash_3u32((__force u32)saddr, (__force u32)daddr, in secure_tcp_seq() 145 return seq_scale(hash); in secure_tcp_seq()
|
D | sock_map.c | 856 u32 hash; member 882 u32 hash) in sock_hash_select_bucket() argument 884 return &htab->buckets[hash & (htab->buckets_num - 1)]; in sock_hash_select_bucket() 888 sock_hash_lookup_elem_raw(struct hlist_head *head, u32 hash, void *key, in sock_hash_lookup_elem_raw() argument 894 if (elem->hash == hash && in sock_hash_lookup_elem_raw() 905 u32 key_size = map->key_size, hash; in __sock_hash_lookup_elem() local 911 hash = sock_hash_bucket_hash(key, key_size); in __sock_hash_lookup_elem() 912 bucket = sock_hash_select_bucket(htab, hash); in __sock_hash_lookup_elem() 913 elem = sock_hash_lookup_elem_raw(&bucket->head, hash, key, key_size); in __sock_hash_lookup_elem() 933 bucket = sock_hash_select_bucket(htab, elem->hash); in sock_hash_delete_from_link() [all …]
|
/net/ipv6/ |
D | inet6_hashtables.c | 65 unsigned int hash = inet6_ehashfn(net, daddr, hnum, saddr, sport); in __inet6_lookup_established() local 66 unsigned int slot = hash & hashinfo->ehash_mask; in __inet6_lookup_established() 72 if (sk->sk_hash != hash) in __inet6_lookup_established() 258 const unsigned int hash = inet6_ehashfn(net, daddr, lport, saddr, in __inet6_check_established() local 260 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); in __inet6_check_established() 261 spinlock_t *lock = inet_ehash_lockp(hinfo, hash); in __inet6_check_established() 269 if (sk2->sk_hash != hash) in __inet6_check_established() 288 sk->sk_hash = hash; in __inet6_check_established()
|
/net/sched/ |
D | sch_sfq.c | 106 unsigned short hash; /* hash value (index in ht[]) */ member 321 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_drop() 349 unsigned int hash, dropped; in sfq_enqueue() local 356 hash = sfq_classify(skb, sch, &ret); in sfq_enqueue() 357 if (hash == 0) { in sfq_enqueue() 363 hash--; in sfq_enqueue() 365 x = q->ht[hash]; in sfq_enqueue() 371 q->ht[hash] = x; in sfq_enqueue() 373 slot->hash = hash; in sfq_enqueue() 507 q->ht[slot->hash] = SFQ_EMPTY_SLOT; in sfq_dequeue() [all …]
|
/net/unix/ |
D | af_unix.c | 128 unsigned long hash = (unsigned long)addr; in unix_sockets_unbound() local 130 hash ^= hash >> 16; in unix_sockets_unbound() 131 hash ^= hash >> 8; in unix_sockets_unbound() 132 hash %= UNIX_HASH_SIZE; in unix_sockets_unbound() 133 return &unix_socket_table[UNIX_HASH_SIZE + hash]; in unix_sockets_unbound() 136 #define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash < UNIX_HASH_SIZE) 174 unsigned int hash = (__force unsigned int)csum_fold(n); in unix_hash_fold() local 176 hash ^= hash>>8; in unix_hash_fold() 177 return hash&(UNIX_HASH_SIZE-1); in unix_hash_fold() 281 int len, int type, unsigned int hash) in __unix_find_socket_byname() argument [all …]
|