def __init__(self, integ_br, tun_br, local_ip,
bridge_mappings, root_helper,
- polling_interval, tunnel_types=None):
+ polling_interval, tunnel_types=None,
+ veth_mtu=None):
'''Constructor.
:param integ_br: name of the integration bridge.
:param tunnel_types: A list of tunnel types to enable support for in
the agent. If set, will automatically set enable_tunneling to
True.
+ :param veth_mtu: MTU size for veth interfaces.
'''
+ self.veth_mtu = veth_mtu
self.root_helper = root_helper
self.available_local_vlans = set(xrange(q_const.MIN_VLAN_TAG,
q_const.MAX_VLAN_TAG))
int_veth.link.set_up()
phys_veth.link.set_up()
+ if self.veth_mtu:
+ # set up mtu size for veth interfaces
+ int_veth.link.set_mtu(self.veth_mtu)
+ phys_veth.link.set_mtu(self.veth_mtu)
+
def update_ports(self, registered_ports):
ports = self.int_br.get_vif_port_set()
if ports == registered_ports:
root_helper=config.AGENT.root_helper,
polling_interval=config.AGENT.polling_interval,
tunnel_types=config.AGENT.tunnel_types,
+ veth_mtu=config.AGENT.veth_mtu,
)
# If enable_tunneling is TRUE, set tunnel_type to default to GRE
mock.patch.object(self.agent.int_br, "delete_port"),
mock.patch.object(ip_lib.IPWrapper, "add_veth"),
mock.patch.object(ip_lib.IpLinkCommand, "delete"),
- mock.patch.object(ip_lib.IpLinkCommand, "set_up")
+ mock.patch.object(ip_lib.IpLinkCommand, "set_up"),
+ mock.patch.object(ip_lib.IpLinkCommand, "set_mtu")
) as (devex_fn, sysexit_fn, remflows_fn, ovs_addfl_fn,
ovs_addport_fn, ovs_delport_fn, br_addport_fn,
- br_delport_fn, addveth_fn, linkdel_fn, linkset_fn):
+ br_delport_fn, addveth_fn, linkdel_fn, linkset_fn, linkmtu_fn):
devex_fn.return_value = True
addveth_fn.return_value = (ip_lib.IPDevice("int-br-eth1"),
ip_lib.IPDevice("phy-br-eth1"))
self.INT_OFPORT = 11111
self.TUN_OFPORT = 22222
self.MAP_TUN_OFPORT = 33333
+ self.VETH_MTU = None
self.inta = self.mox.CreateMock(ip_lib.IPDevice)
self.intb = self.mox.CreateMock(ip_lib.IPDevice)
self.inta.link = self.mox.CreateMock(ip_lib.IpLinkCommand)
ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
self.mox.VerifyAll()
def testConstructVXLAN(self):
ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['vxlan'])
+ 'sudo', 2, ['vxlan'],
+ self.VETH_MTU)
self.mox.VerifyAll()
def testProvisionLocalVlan(self):
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.available_local_vlans = set([LV_ID])
a.provision_local_vlan(NET_UUID, constants.TYPE_GRE, None, LS_ID)
self.mox.VerifyAll()
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.available_local_vlans = set([LV_ID])
a.phys_brs['net1'] = self.mock_map_tun_bridge
a.phys_ofports['net1'] = self.MAP_TUN_OFPORT
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.provision_local_vlan(NET_UUID, constants.TYPE_FLAT, 'net2', LS_ID)
self.mox.VerifyAll()
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.available_local_vlans = set([LV_ID])
a.phys_brs['net1'] = self.mock_map_tun_bridge
a.phys_ofports['net1'] = self.MAP_TUN_OFPORT
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.provision_local_vlan(NET_UUID, constants.TYPE_VLAN, 'net2', LS_ID)
self.mox.VerifyAll()
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.available_local_vlans = set()
a.local_vlan_map[NET_UUID] = LVM
a.reclaim_local_vlan(NET_UUID, LVM)
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.phys_brs['net1'] = self.mock_map_tun_bridge
a.phys_ofports['net1'] = self.MAP_TUN_OFPORT
a.int_ofports['net1'] = self.INT_OFPORT
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.phys_brs['net1'] = self.mock_map_tun_bridge
a.phys_ofports['net1'] = self.MAP_TUN_OFPORT
a.int_ofports['net1'] = self.INT_OFPORT
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.local_vlan_map[NET_UUID] = LVM
a.port_bound(VIF_PORT, NET_UUID, 'gre', None, LS_ID)
self.mox.VerifyAll()
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.local_vlan_map[NET_UUID] = LVM
a.port_bound(VIF_PORT, NET_UUID, 'gre', None, LS_ID)
a.available_local_vlans = set([LV_ID])
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.available_local_vlans = set([LV_ID])
a.local_vlan_map[NET_UUID] = LVM
a.port_dead(VIF_PORT)
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.tunnel_update(
mox.MockAnything, tunnel_id='1', tunnel_ip='10.0.10.1',
tunnel_type=constants.TYPE_GRE)
a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE,
self.TUN_BRIDGE,
'10.0.0.1', self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
a.tunnel_update(
mox.MockAnything, tunnel_id='1', tunnel_ip='10.0.0.1')
self.mox.VerifyAll()
self.TUN_BRIDGE,
'10.0.0.1',
self.NET_MAPPING,
- 'sudo', 2, ['gre'])
+ 'sudo', 2, ['gre'],
+ self.VETH_MTU)
# Hack to test loop
# We start method and expect it will raise after 2nd loop
pass
self.mox.VerifyAll()
+
+
+class TunnelTestWithMTU(TunnelTest):
+
+ def setUp(self):
+ super(TunnelTestWithMTU, self).setUp()
+ self.VETH_MTU = 1500
+ self.inta.link.set_mtu(self.VETH_MTU)
+ self.intb.link.set_mtu(self.VETH_MTU)