Lines Matching refs:udptable
242 struct udp_table *udptable = udp_get_table_prot(sk); in udp_lib_get_port() local
261 rand = (rand | 1) * (udptable->mask + 1); in udp_lib_get_port()
262 last = first + udptable->mask + 1; in udp_lib_get_port()
264 hslot = udp_hashslot(udptable, net, first); in udp_lib_get_port()
268 udptable->log); in udp_lib_get_port()
278 !test_bit(snum >> udptable->log, bitmap) && in udp_lib_get_port()
288 hslot = udp_hashslot(udptable, net, snum); in udp_lib_get_port()
294 slot2 &= udptable->mask; in udp_lib_get_port()
295 hash2_nulladdr &= udptable->mask; in udp_lib_get_port()
297 hslot2 = udp_hashslot2(udptable, slot2); in udp_lib_get_port()
303 hslot2 = udp_hashslot2(udptable, hash2_nulladdr); in udp_lib_get_port()
333 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_get_port()
474 int sdif, struct udp_table *udptable, struct sk_buff *skb) in __udp4_lib_lookup() argument
482 slot2 = hash2 & udptable->mask; in __udp4_lib_lookup()
483 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_lookup()
494 udptable == net->ipv4.udp_table) { in __udp4_lib_lookup()
510 slot2 = hash2 & udptable->mask; in __udp4_lib_lookup()
511 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_lookup()
525 struct udp_table *udptable) in __udp4_lib_lookup_skb() argument
531 inet_sdif(skb), udptable, skb); in __udp4_lib_lookup_skb()
641 struct udp_table *udptable, in __udp4_lib_err_encap() argument
670 udptable, NULL); in __udp4_lib_err_encap()
700 int __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable) in __udp4_lib_err() argument
715 inet_sdif(skb), udptable, NULL); in __udp4_lib_err()
720 sk = __udp4_lib_err_encap(net, iph, uh, udptable, sk, skb, in __udp4_lib_err()
1951 struct udp_table *udptable = udp_get_table_prot(sk); in udp_lib_unhash() local
1954 hslot = udp_hashslot(udptable, sock_net(sk), in udp_lib_unhash()
1956 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_unhash()
1982 struct udp_table *udptable = udp_get_table_prot(sk); in udp_lib_rehash() local
1985 hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash); in udp_lib_rehash()
1986 nhslot2 = udp_hashslot2(udptable, newhash); in udp_lib_rehash()
1991 hslot = udp_hashslot(udptable, sock_net(sk), in udp_lib_rehash()
2224 struct udp_table *udptable, in __udp4_lib_mcast_deliver() argument
2229 struct udp_hslot *hslot = udp_hashslot(udptable, net, hnum); in __udp4_lib_mcast_deliver()
2239 udptable->mask; in __udp4_lib_mcast_deliver()
2240 hash2 = ipv4_portaddr_hash(net, daddr, hnum) & udptable->mask; in __udp4_lib_mcast_deliver()
2242 hslot = &udptable->hash2[hash2]; in __udp4_lib_mcast_deliver()
2358 int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, in __udp4_lib_rcv() argument
2416 saddr, daddr, udptable, proto); in __udp4_lib_rcv()
2418 sk = __udp4_lib_lookup_skb(skb, uh->source, uh->dest, udptable); in __udp4_lib_rcv()
2475 struct udp_table *udptable = net->ipv4.udp_table; in __udp4_lib_mcast_demux_lookup() local
2481 slot = udp_hashfn(net, hnum, udptable->mask); in __udp4_lib_mcast_demux_lookup()
2482 hslot = &udptable->hash[slot]; in __udp4_lib_mcast_demux_lookup()
2510 struct udp_table *udptable = net->ipv4.udp_table; in __udp4_lib_demux_lookup() local
2519 slot2 = hash2 & udptable->mask; in __udp4_lib_demux_lookup()
2520 hslot2 = &udptable->hash2[slot2]; in __udp4_lib_demux_lookup()
2966 struct udp_table *udptable; in udp_get_first() local
2969 udptable = udp_get_table_seq(seq, net); in udp_get_first()
2971 for (state->bucket = start; state->bucket <= udptable->mask; in udp_get_first()
2973 struct udp_hslot *hslot = &udptable->hash[state->bucket]; in udp_get_first()
2994 struct udp_table *udptable; in udp_get_next() local
3001 udptable = udp_get_table_seq(seq, net); in udp_get_next()
3003 if (state->bucket <= udptable->mask) in udp_get_next()
3004 spin_unlock_bh(&udptable->hash[state->bucket].lock); in udp_get_next()
3047 struct udp_table *udptable; in udp_seq_stop() local
3049 udptable = udp_get_table_seq(seq, seq_file_net(seq)); in udp_seq_stop()
3051 if (state->bucket <= udptable->mask) in udp_seq_stop()
3052 spin_unlock_bh(&udptable->hash[state->bucket].lock); in udp_seq_stop()
3119 struct udp_table *udptable; in bpf_iter_udp_batch() local
3130 udptable = udp_get_table_seq(seq, net); in bpf_iter_udp_batch()
3145 for (; state->bucket <= udptable->mask; state->bucket++) { in bpf_iter_udp_batch()
3146 struct udp_hslot *hslot2 = &udptable->hash2[state->bucket]; in bpf_iter_udp_batch()
3438 struct udp_table *udptable; in udp_pernet_table_alloc() local
3441 udptable = kmalloc(sizeof(*udptable), GFP_KERNEL); in udp_pernet_table_alloc()
3442 if (!udptable) in udp_pernet_table_alloc()
3445 udptable->hash = vmalloc_huge(hash_entries * 2 * sizeof(struct udp_hslot), in udp_pernet_table_alloc()
3447 if (!udptable->hash) in udp_pernet_table_alloc()
3450 udptable->hash2 = udptable->hash + hash_entries; in udp_pernet_table_alloc()
3451 udptable->mask = hash_entries - 1; in udp_pernet_table_alloc()
3452 udptable->log = ilog2(hash_entries); in udp_pernet_table_alloc()
3455 INIT_HLIST_HEAD(&udptable->hash[i].head); in udp_pernet_table_alloc()
3456 udptable->hash[i].count = 0; in udp_pernet_table_alloc()
3457 spin_lock_init(&udptable->hash[i].lock); in udp_pernet_table_alloc()
3459 INIT_HLIST_HEAD(&udptable->hash2[i].head); in udp_pernet_table_alloc()
3460 udptable->hash2[i].count = 0; in udp_pernet_table_alloc()
3461 spin_lock_init(&udptable->hash2[i].lock); in udp_pernet_table_alloc()
3464 return udptable; in udp_pernet_table_alloc()
3467 kfree(udptable); in udp_pernet_table_alloc()
3474 struct udp_table *udptable = net->ipv4.udp_table; in udp_pernet_table_free() local
3476 if (udptable == &udp_table) in udp_pernet_table_free()
3479 kvfree(udptable->hash); in udp_pernet_table_free()
3480 kfree(udptable); in udp_pernet_table_free()
3485 struct udp_table *udptable; in udp_set_table() local
3503 udptable = udp_pernet_table_alloc(hash_entries); in udp_set_table()
3504 if (udptable) { in udp_set_table()
3505 net->ipv4.udp_table = udptable; in udp_set_table()