summaryrefslogtreecommitdiff
path: root/datapath/vport-patch.c
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 /datapath/vport-patch.c
parentbfa68a2b1fc49a8755748548836e92a5bae7bcb3 (diff)
downloadopenvswitch-f915f1a8ca180828983ef22cf2fd21b8f010b972.tar.gz
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 'datapath/vport-patch.c')
-rw-r--r--datapath/vport-patch.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/datapath/vport-patch.c b/datapath/vport-patch.c
index 7dfea6ba6..1c4d2c5e2 100644
--- a/datapath/vport-patch.c
+++ b/datapath/vport-patch.c
@@ -20,7 +20,6 @@ struct patch_config {
char peer_name[IFNAMSIZ];
unsigned char eth_addr[ETH_ALEN];
- unsigned int mtu;
};
struct patch_vport {
@@ -148,10 +147,6 @@ static struct vport *patch_create(const struct vport_parms *parms)
vport_gen_rand_ether_addr(patchconf->eth_addr);
- /* Make the default MTU fairly large so that it doesn't become the
- * bottleneck on systems using jumbo frames. */
- patchconf->mtu = 65535;
-
rcu_assign_pointer(patch_vport->patchconf, patchconf);
peer_name = patchconf->peer_name;
@@ -236,22 +231,6 @@ static void update_peers(const char *name, struct vport *vport)
}
}
-static int patch_set_mtu(struct vport *vport, int mtu)
-{
- struct patch_vport *patch_vport = patch_vport_priv(vport);
- struct patch_config *patchconf;
-
- patchconf = kmemdup(rtnl_dereference(patch_vport->patchconf),
- sizeof(struct patch_config), GFP_KERNEL);
- if (!patchconf)
- return -ENOMEM;
-
- patchconf->mtu = mtu;
- assign_config_rcu(vport, patchconf);
-
- return 0;
-}
-
static int patch_set_addr(struct vport *vport, const unsigned char *addr)
{
struct patch_vport *patch_vport = patch_vport_priv(vport);
@@ -289,12 +268,6 @@ static int patch_get_options(const struct vport *vport, struct sk_buff *skb)
return nla_put_string(skb, ODP_PATCH_ATTR_PEER, patchconf->peer_name);
}
-static int patch_get_mtu(const struct vport *vport)
-{
- const struct patch_vport *patch_vport = patch_vport_priv(vport);
- return rcu_dereference_rtnl(patch_vport->patchconf)->mtu;
-}
-
static int patch_send(struct vport *vport, struct sk_buff *skb)
{
struct patch_vport *patch_vport = patch_vport_priv(vport);
@@ -319,7 +292,6 @@ const struct vport_ops patch_vport_ops = {
.exit = patch_exit,
.create = patch_create,
.destroy = patch_destroy,
- .set_mtu = patch_set_mtu,
.set_addr = patch_set_addr,
.get_name = patch_get_name,
.get_addr = patch_get_addr,
@@ -328,6 +300,5 @@ const struct vport_ops patch_vport_ops = {
.get_dev_flags = vport_gen_get_dev_flags,
.is_running = vport_gen_is_running,
.get_operstate = vport_gen_get_operstate,
- .get_mtu = patch_get_mtu,
.send = patch_send,
};