Bug 1488484
| Summary: | GRE: IFLA_MTU ignored on NEWLINK | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Eric Garver <egarver> |
| Component: | kernel | Assignee: | Xin Long <lxin> |
| kernel sub component: | Tunnel | QA Contact: | Jianlin Shi <jishi> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | high | CC: | atragler, haliu, jbenc, lxin, network-qe, sbrivio, sukulkar |
| Version: | 7.4 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | kernel-3.10.0-915.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-30 08:18:07 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1323132 | ||
|
Description
Eric Garver
2017-09-05 13:52:14 UTC
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. 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 |