diff options
author | David Wragg <david@weave.works> | 2016-02-10 00:05:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-10 05:50:03 -0500 |
commit | 7e059158d57b79159eaf1f504825d19866ef2c42 (patch) | |
tree | 08f87eb3b0e08a48203e1ec95b2ddd00b91ca412 /drivers/net/geneve.c | |
parent | 55e5bfb53cff286c1c1ff49f51325dc15c7fea63 (diff) | |
download | blackbird-obmc-linux-7e059158d57b79159eaf1f504825d19866ef2c42.tar.gz blackbird-obmc-linux-7e059158d57b79159eaf1f504825d19866ef2c42.zip |
vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices
Prior to 4.3, openvswitch tunnel vports (vxlan, gre and geneve) could
transmit vxlan packets of any size, constrained only by the ability to
send out the resulting packets. 4.3 introduced netdevs corresponding
to tunnel vports. These netdevs have an MTU, which limits the size of
a packet that can be successfully encapsulated. The default MTU
values are low (1500 or less), which is awkwardly small in the context
of physical networks supporting jumbo frames, and leads to a
conspicuous change in behaviour for userspace.
Instead, set the MTU on openvswitch-created netdevs to be the relevant
maximum (i.e. the maximum IP packet size minus any relevant overhead),
effectively restoring the behaviour prior to 4.3.
Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r-- | drivers/net/geneve.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index d2031ce8baea..028e3873c310 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1453,11 +1453,21 @@ struct net_device *geneve_dev_create_fb(struct net *net, const char *name, err = geneve_configure(net, dev, &geneve_remote_unspec, 0, 0, 0, htons(dst_port), true, 0); - if (err) { - free_netdev(dev); - return ERR_PTR(err); - } + if (err) + goto err; + + /* openvswitch users expect packet sizes to be unrestricted, + * so set the largest MTU we can. + */ + err = geneve_change_mtu(dev, IP_MAX_MTU); + if (err) + goto err; + return dev; + + err: + free_netdev(dev); + return ERR_PTR(err); } EXPORT_SYMBOL_GPL(geneve_dev_create_fb); |