Lines Matching refs:udptable

240 	struct udp_table *udptable = udp_get_table_prot(sk);  in udp_lib_get_port()  local
259 rand = (rand | 1) * (udptable->mask + 1); in udp_lib_get_port()
260 last = first + udptable->mask + 1; in udp_lib_get_port()
262 hslot = udp_hashslot(udptable, net, first); in udp_lib_get_port()
266 udptable->log); in udp_lib_get_port()
276 !test_bit(snum >> udptable->log, bitmap) && in udp_lib_get_port()
286 hslot = udp_hashslot(udptable, net, snum); in udp_lib_get_port()
292 slot2 &= udptable->mask; in udp_lib_get_port()
293 hash2_nulladdr &= udptable->mask; in udp_lib_get_port()
295 hslot2 = udp_hashslot2(udptable, slot2); in udp_lib_get_port()
301 hslot2 = udp_hashslot2(udptable, hash2_nulladdr); in udp_lib_get_port()
331 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_get_port()
467 struct udp_table *udptable, in udp4_lookup_run_bpf() argument
475 if (udptable != net->ipv4.udp_table) in udp4_lookup_run_bpf()
494 int sdif, struct udp_table *udptable, struct sk_buff *skb) in __udp4_lib_lookup() argument
502 slot2 = hash2 & udptable->mask; in __udp4_lib_lookup()
503 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_lookup()
514 sk = udp4_lookup_run_bpf(net, udptable, skb, in __udp4_lib_lookup()
528 slot2 = hash2 & udptable->mask; in __udp4_lib_lookup()
529 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_lookup()
543 struct udp_table *udptable) in __udp4_lib_lookup_skb() argument
549 inet_sdif(skb), udptable, skb); in __udp4_lib_lookup_skb()
656 struct udp_table *udptable, in __udp4_lib_err_encap() argument
685 udptable, NULL); in __udp4_lib_err_encap()
715 int __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable) in __udp4_lib_err() argument
730 inet_sdif(skb), udptable, NULL); in __udp4_lib_err()
735 sk = __udp4_lib_err_encap(net, iph, uh, udptable, sk, skb, in __udp4_lib_err()
2008 struct udp_table *udptable = udp_get_table_prot(sk); in udp_lib_unhash() local
2011 hslot = udp_hashslot(udptable, sock_net(sk), in udp_lib_unhash()
2013 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_unhash()
2039 struct udp_table *udptable = udp_get_table_prot(sk); in udp_lib_rehash() local
2042 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_rehash()
2043 nhslot2 = udp_hashslot2(udptable, newhash); in udp_lib_rehash()
2048 hslot = udp_hashslot(udptable, sock_net(sk), in udp_lib_rehash()
2281 struct udp_table *udptable, in __udp4_lib_mcast_deliver() argument
2286 struct udp_hslot *hslot = udp_hashslot(udptable, net, hnum); in __udp4_lib_mcast_deliver()
2296 udptable->mask; in __udp4_lib_mcast_deliver()
2297 hash2 = ipv4_portaddr_hash(net, daddr, hnum) & udptable->mask; in __udp4_lib_mcast_deliver()
2299 hslot = &udptable->hash2[hash2]; in __udp4_lib_mcast_deliver()
2415 int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, in __udp4_lib_rcv() argument
2469 saddr, daddr, udptable, proto); in __udp4_lib_rcv()
2471 sk = __udp4_lib_lookup_skb(skb, uh->source, uh->dest, udptable); in __udp4_lib_rcv()
2528 struct udp_table *udptable = net->ipv4.udp_table; in __udp4_lib_mcast_demux_lookup() local
2534 slot = udp_hashfn(net, hnum, udptable->mask); in __udp4_lib_mcast_demux_lookup()
2535 hslot = &udptable->hash[slot]; in __udp4_lib_mcast_demux_lookup()
2563 struct udp_table *udptable = net->ipv4.udp_table; in __udp4_lib_demux_lookup() local
2572 slot2 = hash2 & udptable->mask; in __udp4_lib_demux_lookup()
2573 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_demux_lookup()
2997 struct udp_table *udptable; in udp_get_first() local
3005 udptable = udp_get_table_afinfo(afinfo, net); in udp_get_first()
3007 for (state->bucket = start; state->bucket <= udptable->mask; in udp_get_first()
3009 struct udp_hslot *hslot = &udptable->hash[state->bucket]; in udp_get_first()
3034 struct udp_table *udptable; in udp_get_next() local
3048 udptable = udp_get_table_afinfo(afinfo, net); in udp_get_next()
3050 if (state->bucket <= udptable->mask) in udp_get_next()
3051 spin_unlock_bh(&udptable->hash[state->bucket].lock); in udp_get_next()
3095 struct udp_table *udptable; in udp_seq_stop() local
3102 udptable = udp_get_table_afinfo(afinfo, seq_file_net(seq)); in udp_seq_stop()
3104 if (state->bucket <= udptable->mask) in udp_seq_stop()
3105 spin_unlock_bh(&udptable->hash[state->bucket].lock); in udp_seq_stop()
3317 struct udp_table *udptable; in udp_pernet_table_alloc() local
3320 udptable = kmalloc(sizeof(*udptable), GFP_KERNEL); in udp_pernet_table_alloc()
3321 if (!udptable) in udp_pernet_table_alloc()
3324 udptable->hash = vmalloc_huge(hash_entries * 2 * sizeof(struct udp_hslot), in udp_pernet_table_alloc()
3326 if (!udptable->hash) in udp_pernet_table_alloc()
3329 udptable->hash2 = udptable->hash + hash_entries; in udp_pernet_table_alloc()
3330 udptable->mask = hash_entries - 1; in udp_pernet_table_alloc()
3331 udptable->log = ilog2(hash_entries); in udp_pernet_table_alloc()
3334 INIT_HLIST_HEAD(&udptable->hash[i].head); in udp_pernet_table_alloc()
3335 udptable->hash[i].count = 0; in udp_pernet_table_alloc()
3336 spin_lock_init(&udptable->hash[i].lock); in udp_pernet_table_alloc()
3338 INIT_HLIST_HEAD(&udptable->hash2[i].head); in udp_pernet_table_alloc()
3339 udptable->hash2[i].count = 0; in udp_pernet_table_alloc()
3340 spin_lock_init(&udptable->hash2[i].lock); in udp_pernet_table_alloc()
3343 return udptable; in udp_pernet_table_alloc()
3346 kfree(udptable); in udp_pernet_table_alloc()
3353 struct udp_table *udptable = net->ipv4.udp_table; in udp_pernet_table_free() local
3355 if (udptable == &udp_table) in udp_pernet_table_free()
3358 kvfree(udptable->hash); in udp_pernet_table_free()
3359 kfree(udptable); in udp_pernet_table_free()
3364 struct udp_table *udptable; in udp_set_table() local
3382 udptable = udp_pernet_table_alloc(hash_entries); in udp_set_table()
3383 if (udptable) { in udp_set_table()
3384 net->ipv4.udp_table = udptable; in udp_set_table()