• Eric Dumazet's avatar
    udp: secondary hash on (local port, local address) · 512615b6
    Eric Dumazet authored
    Extends udp_table to contain a secondary hash table.
    
    socket anchor for this second hash is free, because UDP
    doesnt use skc_bind_node : We define an union to hold
    both skc_bind_node & a new hlist_nulls_node udp_portaddr_node
    
    udp_lib_get_port() inserts sockets into second hash chain
    (additional cost of one atomic op)
    
    udp_lib_unhash() deletes socket from second hash chain
    (additional cost of one atomic op)
    
    Note : No spinlock lockdep annotation is needed, because
    lock for the secondary hash chain is always get after
    lock for primary hash chain.
    Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    512615b6
udp.h 7.23 KB