ip6_gre: update dst pmtu if dev mtu has been updated by toobig in __gre6_xmit
commit8aec4959d832bae0889a8e2f348973b5e4abffef
authorXin Long <lucien.xin@gmail.com>
Thu, 26 Oct 2017 11:27:17 +0000 (26 19:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 14:45:42 +0000 (27 23:45 +0900)
tree836c695f7362deabd94423583c1b71a5174c6f72
parentf8d20b46ce55cf40afb30dcef6d9288f7ef46d9b
ip6_gre: update dst pmtu if dev mtu has been updated by toobig in __gre6_xmit

When receiving a Toobig icmpv6 packet, ip6gre_err would just set
tunnel dev's mtu, that's not enough. For skb_dst(skb)'s pmtu may
still be using the old value, it has no chance to be updated with
tunnel dev's mtu.

Jianlin found this issue by reducing route's mtu while running
netperf, the performance went to 0.

ip6ip6 and ip4ip6 tunnel can work well with this, as they lookup
the upper dst and update_pmtu it's pmtu or icmpv6_send a Toobig
to upper socket after setting tunnel dev's mtu.

We couldn't do that for ip6_gre, as gre's inner packet could be
any protocol, it's difficult to handle them (like lookup upper
dst) in a good way.

So this patch is to fix it by updating skb_dst(skb)'s pmtu when
dev->mtu < skb_dst(skb)'s pmtu in tx path. It's safe to do this
update there, as usually dev->mtu <= skb_dst(skb)'s pmtu and no
performance regression can be caused by this.

Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c