Merge "Allow to config network MTU"
This commit is contained in:
commit
65c31a43ae
@ -39,12 +39,9 @@ class BaseBridgeDriver(health.HealthHandler, b_base.BaseBindingDriver):
|
|||||||
with b_base.get_ipdb() as h_ipdb:
|
with b_base.get_ipdb() as h_ipdb:
|
||||||
self._remove_ifaces(h_ipdb, (host_ifname,))
|
self._remove_ifaces(h_ipdb, (host_ifname,))
|
||||||
|
|
||||||
if vif.network.mtu:
|
interface_mtu = vif.network.mtu
|
||||||
interface_mtu = vif.network.mtu
|
mtu_cfg = CONF.neutron_defaults.network_device_mtu
|
||||||
else:
|
if mtu_cfg and mtu_cfg < interface_mtu:
|
||||||
LOG.info("Default mtu %(mtu)s is used for interface, "
|
|
||||||
"for mtu of network if configured with 0",
|
|
||||||
{"mtu": CONF.neutron_defaults.network_device_mtu})
|
|
||||||
interface_mtu = CONF.neutron_defaults.network_device_mtu
|
interface_mtu = CONF.neutron_defaults.network_device_mtu
|
||||||
|
|
||||||
with b_base.get_ipdb(netns) as c_ipdb:
|
with b_base.get_ipdb(netns) as c_ipdb:
|
||||||
|
@ -223,7 +223,7 @@ neutron_defaults = [
|
|||||||
default=None),
|
default=None),
|
||||||
cfg.IntOpt('network_device_mtu',
|
cfg.IntOpt('network_device_mtu',
|
||||||
help='Default MTU setting for network interface.',
|
help='Default MTU setting for network interface.',
|
||||||
default=1500,),
|
default=0,),
|
||||||
cfg.IntOpt('lbaas_activation_timeout',
|
cfg.IntOpt('lbaas_activation_timeout',
|
||||||
help=_("Time (in seconds) that kuryr controller waits for "
|
help=_("Time (in seconds) that kuryr controller waits for "
|
||||||
"neutron LBaaS to be activated"),
|
"neutron LBaaS to be activated"),
|
||||||
|
@ -158,10 +158,13 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
|
|||||||
except StopIteration:
|
except StopIteration:
|
||||||
LOG.debug('Network does not exist. Creating.')
|
LOG.debug('Network does not exist. Creating.')
|
||||||
|
|
||||||
|
mtu_cfg = oslo_cfg.CONF.neutron_defaults.network_device_mtu
|
||||||
|
attrs = {'name': net_name, 'project_id': project_id}
|
||||||
|
if mtu_cfg:
|
||||||
|
attrs['mtu'] = mtu_cfg
|
||||||
# create network with namespace as name
|
# create network with namespace as name
|
||||||
try:
|
try:
|
||||||
neutron_net = os_net.create_network(name=net_name,
|
neutron_net = os_net.create_network(**attrs)
|
||||||
project_id=project_id)
|
|
||||||
c_utils.tag_neutron_resources([neutron_net])
|
c_utils.tag_neutron_resources([neutron_net])
|
||||||
except os_exc.SDKException:
|
except os_exc.SDKException:
|
||||||
LOG.exception("Error creating neutron resources for the namespace "
|
LOG.exception("Error creating neutron resources for the namespace "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user