• Xin Long's avatar
    ip_gre: set tunnel hlen properly in erspan_tunnel_init · c122fda2
    Xin Long authored
    According to __gre_tunnel_init, tunnel->hlen should be set as the
    headers' length between inner packet and outer iphdr.
    
    It would be used especially to calculate a proper mtu when updating
    mtu in tnl_update_pmtu. Now without setting it, a bigger mtu value
    than expected would be updated, which hurts performance a lot.
    
    This patch is to fix it by setting tunnel->hlen with:
       tunnel->tun_hlen + tunnel->encap_hlen + sizeof(struct erspanhdr)
    
    Fixes: 84e54fe0 ("gre: introduce native tunnel support for ERSPAN")
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c122fda2
ip_gre.c 42.2 KB