From: David Wragg <david-1SEAoVOfG6VEzL6FDj/jAg@public.gmane.org>
To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org
Cc: David Wragg <david-1SEAoVOfG6VEzL6FDj/jAg@public.gmane.org>,
Roopa Prabhu
<roopa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>,
Hannes Frederic Sowa
<hannes-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r@public.gmane.org>,
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: [PATCH net v2 2/3] geneve: Relax MTU constraints
Date: Tue, 9 Feb 2016 16:47:03 +0000 [thread overview]
Message-ID: <1455036424-6403-3-git-send-email-david@weave.works> (raw)
In-Reply-To: <1455036424-6403-1-git-send-email-david-1SEAoVOfG6VEzL6FDj/jAg@public.gmane.org>
Allow the MTU of geneve devices to be set to large values, in order to
exploit underlying networks with larger frame sizes.
GENEVE does not have a fixed encapsulation overhead (an openvswitch
rule can add variable length options), so there is no relevant maximum
MTU to enforce. A maximum of IP_MAX_MTU is used instead.
Encapsulated packets that are too big for the underlying network will
get dropped on the floor.
Signed-off-by: David Wragg <david@weave.works>
---
drivers/net/geneve.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 0b14ac3..05cef11 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1039,6 +1039,16 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
return geneve_xmit_skb(skb, dev, info);
}
+static int geneve_change_mtu(struct net_device *dev, int new_mtu)
+{
+ /* GENEVE overhead is not fixed, so we can't enforce a more
+ precise max MTU. */
+ if (new_mtu < 68 || new_mtu > IP_MAX_MTU)
+ return -EINVAL;
+ dev->mtu = new_mtu;
+ return 0;
+}
+
static int geneve_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
{
struct ip_tunnel_info *info = skb_tunnel_info(skb);
@@ -1083,7 +1093,7 @@ static const struct net_device_ops geneve_netdev_ops = {
.ndo_stop = geneve_stop,
.ndo_start_xmit = geneve_xmit,
.ndo_get_stats64 = ip_tunnel_get_stats64,
- .ndo_change_mtu = eth_change_mtu,
+ .ndo_change_mtu = geneve_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_fill_metadata_dst = geneve_fill_metadata_dst,
--
2.5.0
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
next prev parent reply other threads:[~2016-02-09 16:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 16:47 [PATCH net v2 0/3] Set a large MTU on ovs-created tunnel devices David Wragg
2016-02-09 16:47 ` [PATCH net v2 1/3] vxlan: Relax the MTU constraints David Wragg
[not found] ` <1455036424-6403-1-git-send-email-david-1SEAoVOfG6VEzL6FDj/jAg@public.gmane.org>
2016-02-09 16:47 ` David Wragg [this message]
2016-02-09 18:18 ` [PATCH net v2 2/3] geneve: Relax " Sergei Shtylyov
[not found] ` <56BA2D6D.6090408-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-02-09 18:22 ` David Wragg
2016-02-10 7:40 ` Tom Herbert
2016-02-10 11:41 ` David Wragg
2016-02-10 11:59 ` Jesse Gross
2016-02-10 14:21 ` Tom Herbert
[not found] ` <CALx6S36kvXJUZM8_vEmF8L3bxnRiBh98Rs0wAd-HGBJ9Yyde_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-10 14:52 ` Jesse Gross
2016-02-16 12:33 ` David Wragg
2016-02-16 16:44 ` Tom Herbert
2016-02-18 16:54 ` David Wragg
2016-02-18 20:07 ` David Miller
[not found] ` <86bn7e2c3t.fsf-1SEAoVOfG6VEzL6FDj/jAg@public.gmane.org>
2016-02-19 2:11 ` Tom Herbert
2016-02-09 16:47 ` [PATCH net v2 3/3] vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices David Wragg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455036424-6403-3-git-send-email-david@weave.works \
--to=david-1seaovofg6vezl6fdj/jag@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
--cc=hannes-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roopa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).