In OVS 2.8 tunnel ports may be created via the rtnetlink interface. They are created with a default MTU (1500) - whereas on < 2.8 they were created via the older compat interface and used a large (~65490) MTU. To preserve backwards compatibility 2.8+ and rtnetlink should also create tunnel ports with a large MTU. Without this users would have to manually configure the MTU of the tunnel interface.
GRE is the only tunnel type the exhibits this behavior. VXLAN and GENEVE do the right thing. OVS is already setting the IFLA_MTU when creating the interface via rtnetlink. This is actually a kernel bug in the GRE driver. IFLA_MTU is parsed by rtnl_create_link() and sets dev->mtu. But when register_netdevice() is called the GRE driver is overriding dev->mtu inside __gre_tunnel_init().
Same result with ip-link: # ip link add grefoo0 mtu 65000 type gre remote 10.1.1.1 local 10.1.1.2 # ip -d link ... 12: grefoo0@NONE: <POINTOPOINT,NOARP> mtu 1472 qdisc noop state DOWN mode DEFAULT qlen 1 link/gre 10.1.1.2 peer 10.1.1.1 promiscuity 0 gre remote 10.1.1.1 local 10.1.1.2 ttl inherit addrgenmode eui64
OVS has worked around this issue by using a follow up SETLINK [0]. However, this should still be fixed for ip-link/NEWLINK use case. https://mail.openvswitch.org/pipermail/ovs-dev/2018-January/343341.html
A good way to fix it in kernel is: diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 45d97e9..0901de4 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -970,9 +970,6 @@ static void __gre_tunnel_init(struct net_device *dev) t_hlen = tunnel->hlen + sizeof(struct iphdr); - dev->needed_headroom = LL_MAX_HEADER + t_hlen + 4; - dev->mtu = ETH_DATA_LEN - t_hlen - 4; - dev->features |= GRE_FEATURES; dev->hw_features |= GRE_FEATURES; @@ -1290,8 +1287,6 @@ static int erspan_tunnel_init(struct net_device *dev) erspan_hdr_len(tunnel->erspan_ver); t_hlen = tunnel->hlen + sizeof(struct iphdr); - dev->needed_headroom = LL_MAX_HEADER + t_hlen + 4; - dev->mtu = ETH_DATA_LEN - t_hlen - 4; dev->features |= GRE_FEATURES; dev->hw_features |= GRE_FEATURES; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; We've actually discussed to remove these lines before in here: https://patchwork.ozlabs.org/patch/823504/
sure, will go upstream soon.
posted: http://post-office.corp.redhat.com/archives/rhkernel-list/2018-March/msg00412.html
Patch(es) committed on kernel repository and an interim kernel build is undergoing testing
Patch(es) available on kernel-3.10.0-915.el7
Verified on 3.10.0-915: [root@hp-dl380pgen8-02-vm-14 ~]# ip link add grefoo0 mtu 65000 type gre remote 10.1.1.1 local 10.1.1.2 [root@hp-dl380pgen8-02-vm-14 ~]# ip -d link sh grefoo0 8: grefoo0@NONE: <POINTOPOINT,NOARP> mtu 65000 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/gre 10.1.1.2 peer 10.1.1.1 promiscuity 0 gre remote 10.1.1.1 local 10.1.1.2 ttl inherit addrgenmode eui64 numtxqueues 1 numrxqueues1 gso_max_size 65536 gso_max_segs 65535 [root@hp-dl380pgen8-02-vm-14 ~]# uname -a Linux hp-dl380pgen8-02-vm-14.lab.bos.redhat.com 3.10.0-915.el7.x86_64 #1 SMP Fri Jun 22 23:49:29 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:3083