[ovs-dev,3/5] compat: remove the incorrect mtu limit for erspan
diff mbox series

Message ID 1570656134-11957-4-git-send-email-gvrose8192@gmail.com
State New
Headers show
Series
  • Backport upstream Linux kernel patches
Related show

Commit Message

Gregory Rose Oct. 9, 2019, 9:22 p.m. UTC
From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

Upstream commit:
    commit 0e141f757b2c78c983df893e9993313e2dc21e38
    Author: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
    Date:   Fri Sep 27 14:58:20 2019 +0800

    erspan: remove the incorrect mtu limit for erspan

    erspan driver calls ether_setup(), after commit 61e84623ace3
    ("net: centralize net_device min/max MTU checking"), the range
    of mtu is [min_mtu, max_mtu], which is [68, 1500] by default.

    It causes the dev mtu of the erspan device to not be greater
    than 1500, this limit value is not correct for ipgre tap device.

    Tested:
    Before patch:
    # ip link set erspan0 mtu 1600
    Error: mtu greater than device maximum.
    After patch:
    # ip link set erspan0 mtu 1600
    # ip -d link show erspan0
    21: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1600 qdisc noop state DOWN
    mode DEFAULT group default qlen 1000
        link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 0

    Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking")
    Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip_gre.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

0-day Robot Oct. 9, 2019, 10:06 p.m. UTC | #1
Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Haishuang Yan <yanhaishuang@cmss.chinamobile.com> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
Lines checked: 57, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Yi-Hung Wei Oct. 15, 2019, 6:07 p.m. UTC | #2
On Wed, Oct 9, 2019 at 2:25 PM Greg Rose <gvrose8192@gmail.com> wrote:
>
> From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
>
> Upstream commit:
>     commit 0e141f757b2c78c983df893e9993313e2dc21e38
>     Author: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
>     Date:   Fri Sep 27 14:58:20 2019 +0800
>
>     erspan: remove the incorrect mtu limit for erspan
>
>     erspan driver calls ether_setup(), after commit 61e84623ace3
>     ("net: centralize net_device min/max MTU checking"), the range
>     of mtu is [min_mtu, max_mtu], which is [68, 1500] by default.
>
>     It causes the dev mtu of the erspan device to not be greater
>     than 1500, this limit value is not correct for ipgre tap device.
>
>     Tested:
>     Before patch:
>     # ip link set erspan0 mtu 1600
>     Error: mtu greater than device maximum.
>     After patch:
>     # ip link set erspan0 mtu 1600
>     # ip -d link show erspan0
>     21: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1600 qdisc noop state DOWN
>     mode DEFAULT group default qlen 1000
>         link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 0
>
>     Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking")
>     Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---
LGTM.

Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>

Patch
diff mbox series

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 2015d59..2852dad 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -1099,6 +1099,9 @@  static void erspan_setup(struct net_device *dev)
 
 	eth_hw_addr_random(dev);
 	ether_setup(dev);
+#ifdef HAVE_NET_DEVICE_MAX_MTU
+	dev->max_mtu = 0;
+#endif
 	dev->netdev_ops = &erspan_netdev_ops;
 	dev->priv_flags &= ~IFF_TX_SKB_SHARING;
 	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;