mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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.
This commit is contained in:
@@ -2365,6 +2365,11 @@ htb_setup_class__(struct netdev *netdev, unsigned int handle,
|
||||
int mtu;
|
||||
|
||||
netdev_get_mtu(netdev, &mtu);
|
||||
if (mtu == INT_MAX) {
|
||||
VLOG_WARN_RL(&rl, "cannot set up HTB on device %s that lacks MTU",
|
||||
netdev_get_name(netdev));
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
memset(&opt, 0, sizeof opt);
|
||||
tc_fill_rate(&opt.rate, class->min_rate, mtu);
|
||||
@@ -2484,6 +2489,13 @@ htb_parse_class_details__(struct netdev *netdev,
|
||||
const char *priority_s = shash_find_data(details, "priority");
|
||||
int mtu;
|
||||
|
||||
netdev_get_mtu(netdev, &mtu);
|
||||
if (mtu == INT_MAX) {
|
||||
VLOG_WARN_RL(&rl, "cannot parse HTB class on device %s that lacks MTU",
|
||||
netdev_get_name(netdev));
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/* min-rate. Don't allow a min-rate below 1500 bytes/s. */
|
||||
if (!min_rate_s) {
|
||||
/* min-rate is required. */
|
||||
@@ -2509,7 +2521,6 @@ htb_parse_class_details__(struct netdev *netdev,
|
||||
* doesn't include the Ethernet header, we need to add at least 14 (18?) to
|
||||
* the MTU. We actually add 64, instead of 14, as a guard against
|
||||
* additional headers get tacked on somewhere that we're not aware of. */
|
||||
netdev_get_mtu(netdev, &mtu);
|
||||
hc->burst = burst_s ? strtoull(burst_s, NULL, 10) / 8 : 0;
|
||||
hc->burst = MAX(hc->burst, mtu + 64);
|
||||
|
||||
|
Reference in New Issue
Block a user