Bug 1488484 - GRE: IFLA_MTU ignored on NEWLINK
Summary: GRE: IFLA_MTU ignored on NEWLINK
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Xin Long
QA Contact: Jianlin Shi
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 1323132
TreeView+ depends on / blocked
 
Reported: 2017-09-05 13:52 UTC by Eric Garver
Modified: 2018-10-30 08:19 UTC (History)
7 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-10-30 08:18:07 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3083 None None None 2018-10-30 08:19 UTC
Red Hat Bugzilla 1549440 None None None 2019-01-23 06:42 UTC
Red Hat Bugzilla 1549464 None None None 2019-01-23 06:42 UTC
Red Hat Bugzilla 1549467 None None None 2019-01-23 06:42 UTC

Internal Trackers: 1549440 1549464 1549467

Description Eric Garver 2017-09-05 13:52:14 UTC
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.

Comment 2 Eric Garver 2017-09-05 19:05:12 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().

Comment 3 Eric Garver 2017-09-05 19:17:45 UTC
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

Comment 5 Eric Garver 2018-01-18 13:50:51 UTC
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

Comment 6 Xin Long 2018-02-23 08:16:54 UTC
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/

Comment 8 Xin Long 2018-02-23 09:37:51 UTC
sure, will go upstream soon.

Comment 12 Bruno Meneguele 2018-06-23 02:04:19 UTC
Patch(es) committed on kernel repository and an interim kernel build is undergoing testing

Comment 14 Bruno Meneguele 2018-06-23 02:36:48 UTC
Patch(es) available on kernel-3.10.0-915.el7

Comment 16 Jianlin Shi 2018-07-09 01:42:54 UTC
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

Comment 18 errata-xmlrpc 2018-10-30 08:18:07 UTC
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


Note You need to log in before you can comment on or make changes to this bug.