• Eric Dumazet's avatar
    tcp: md5: remove spinlock usage in fast path · 10f22168
    Eric Dumazet authored
    commit 71cea17e upstream.
    
    TCP md5 code uses per cpu variables but protects access to them with
    a shared spinlock, which is a contention point.
    
    [ tcp_md5sig_pool_lock is locked twice per incoming packet ]
    
    Makes things much simpler, by allocating crypto structures once, first
    time a socket needs md5 keys, and not deallocating them as they are
    really small.
    
    Next step would be to allow crypto allocations being done in a NUMA
    aware way.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    [bwh: Backported to 3.2:
     - Adjust context
     - Conditions for alloc/free are quite different]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    10f22168
tcp_ipv6.c 58.9 KB