Revert "lb-agent: ensure tap mtu is the same as physical device"

This reverts commit 6cf9201114.

Conflicts:
	neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
	neutron/tests/unit/plugins/linuxbridge/agent/test_linuxbridge_neutron_agent.py

This hack was used to copy MTU from physical bridges to tap devices to
support Jumbo frames. Now that we have proper MTU behaviour in interface
drivers, this is not needed.

This hack makes all efforts of the interface driver to set the correct
network MTU on all ports ineffective. It breaks multinode grenade
linuxbridge job, among other things.

Even back in Liberty times when it was introduced, there was no real
need to explicitly set Jumbo aware MTU on tap devices from Neutron side.
This could have been achieved by setting network_device_mtu on Nova side
in addition to Neutron:

https://github.com/openstack/nova/blob/liberty-eol/nova/network/linux_net.py#L1590

Change-Id: I53c0eb57da956b36f09731d25db989719e9bc9dc
Related-Bug: #1605271
This commit is contained in:
Ihar Hrachyshka 2016-07-21 16:17:09 +02:00
parent 122a971656
commit d352661c56
2 changed files with 6 additions and 26 deletions

View File

@ -471,14 +471,11 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
if network_type == p_const.TYPE_LOCAL:
self.ensure_local_bridge(network_id, bridge_name)
else:
phy_dev_name = self.ensure_physical_in_bridge(network_id,
network_type,
physical_network,
segmentation_id)
if not phy_dev_name:
return False
self.ensure_tap_mtu(tap_device_name, phy_dev_name)
elif not self.ensure_physical_in_bridge(network_id,
network_type,
physical_network,
segmentation_id):
return False
# Avoid messing with plugging devices into a bridge that the agent
# does not own
if device_owner.startswith(constants.DEVICE_OWNER_PREFIXES):
@ -500,11 +497,6 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
"thus added elsewhere.", data)
return True
def ensure_tap_mtu(self, tap_dev_name, phy_dev_name):
"""Ensure the MTU on the tap is the same as the physical device."""
phy_dev_mtu = ip_lib.IPDevice(phy_dev_name).link.mtu
ip_lib.IPDevice(tap_dev_name).link.set_mtu(phy_dev_mtu)
def plug_interface(self, network_id, network_segment, tap_name,
device_owner):
return self.add_tap_interface(network_id, network_segment.network_type,

View File

@ -558,11 +558,7 @@ class TestLinuxBridgeManager(base.BaseTestCase):
"tap1",
dev_owner_prefix))
with mock.patch.object(self.lbm,
"ensure_physical_in_bridge") as ens_fn,\
mock.patch.object(self.lbm,
"ensure_tap_mtu") as en_mtu_fn,\
mock.patch.object(bridge_lib.BridgeDevice,
"get_interface_bridge") as get_br:
"ensure_physical_in_bridge") as ens_fn:
ens_fn.return_value = False
self.assertFalse(self.lbm.add_tap_interface("123",
p_const.TYPE_VLAN,
@ -570,14 +566,6 @@ class TestLinuxBridgeManager(base.BaseTestCase):
"tap1",
dev_owner_prefix))
ens_fn.return_value = "eth0.1"
get_br.return_value = "brq123"
self.lbm.add_tap_interface("123", p_const.TYPE_VLAN,
"physnet1", "1", "tap1",
dev_owner_prefix)
en_mtu_fn.assert_called_once_with("tap1", "eth0.1")
bridge_device.addif.assert_called_once_with("tap1")
def test_add_tap_interface_owner_network(self):
self._test_add_tap_interface(constants.DEVICE_OWNER_NETWORK_PREFIX)