Skip to content
  • Paolo Abeni's avatar
    udp: implement complete book-keeping for encap_needed · 60fb9567
    Paolo Abeni authored
    
    
    The *encap_needed static keys are enabled by UDP tunnels
    and several UDP encapsulations type, but they are never
    turned off. This can cause unneeded overall performance
    degradation for systems where such features are used
    transiently.
    
    This patch introduces complete book-keeping for such keys,
    decreasing the usage at socket destruction time, if needed,
    and avoiding that the same socket could increase the key
    usage multiple times.
    
    rfc v3 -> v1:
     - add socket lock around udp_tunnel_encap_enable()
    
    rfc v2 -> rfc v3:
     - use udp_tunnel_encap_enable() in setsockopt()
    
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    60fb9567