aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-provider.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-02-01 11:32:06 -0800
committerBen Pfaff <blp@nicira.com>2011-02-04 09:46:26 -0800
commitf915f1a8ca180828983ef22cf2fd21b8f010b972 (patch)
treecd34e78f86df1bdadc7430da75beb75403c27619 /lib/netdev-provider.h
parentbfa68a2b1fc49a8755748548836e92a5bae7bcb3 (diff)
datapath: Consider tunnels to have no MTU, fixing jumbo frame support.
Until now, tunnel vports have had a specific MTU, in the same way that ordinary network devices have an MTU, but treating them this way does not always make sense. For example, consider a datapath that has three ports: the local port, a GRE tunnel to another host, and a physical port. If the physical port is configured with a jumbo MTU, it should be possible to send jumbo packets across the tunnel: the tunnel can do fragmentation or the physical port traversed by the tunnel might have a jumbo MTU. However, until now, tunnels always had a 1500-byte MTU by default. It could be adjusted using ODP_VPORT_MTU_SET, but nothing actually did this. One alternative would be to make ovs-vswitchd able to set the vport's MTU. This commit, however, takes a different approach, of dropping the concept of MTU entirely for tunnel vports. This also solves the problem described above, without making any additional work for anyone. I tested that, without this change, I could not send 1600-byte "pings" between two machines whose NICs had 2000-byte MTUs that were connected to vswitches that were in turn connected over GRE tunnels with the default 1500-byte MTU. With this change, it worked OK, regardless of the MTU of the network traversed by the GRE tunnel. This patch also makes "patch" ports MTU-less. It might make sense to remove vport_set_mtu() and the associated callback now, since ordinary network devices are the only vports that support it now. Signed-off-by: Ben Pfaff <blp@nicira.com> Suggested-by: Jesse Gross <jesse@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #3728.
Diffstat (limited to 'lib/netdev-provider.h')
-rw-r--r--lib/netdev-provider.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 4181758f..be51c48a 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,7 +237,10 @@ struct netdev_class {
*
* The MTU is the maximum size of transmitted (and received) packets, in
* bytes, not including the hardware header; thus, this is typically 1500
- * bytes for Ethernet devices.*/
+ * bytes for Ethernet devices.
+ *
+ * If 'netdev' does not have an MTU (e.g. as some tunnels do not), then
+ * this function should set '*mtup' to INT_MAX. */
int (*get_mtu)(const struct netdev *netdev, int *mtup);
/* Returns the ifindex of 'netdev', if successful, as a positive number.