Set DEFAULT_NETWORK_MTU to 1500 and use it

No more magic numbers.

Change-Id: I5f557c005434e4b922b692ecdffa0b9c4255a1cd
This commit is contained in:
Sean M. Collins 2016-02-25 16:19:44 -05:00
parent ae45cd5732
commit be9fe6a200
3 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,7 @@ from oslo_service import wsgi
from neutron._i18n import _, _LI
from neutron.api.v2 import attributes
from neutron.common import constants
from neutron.common import utils
from neutron import policy
from neutron import version
@ -176,7 +177,7 @@ core_opts = [
help=_("This will choose the web framework in which to run "
"the Neutron API server. 'pecan' is a new experiemental "
"rewrite of the API server.")),
cfg.IntOpt('global_physnet_mtu', default=1500,
cfg.IntOpt('global_physnet_mtu', default=constants.DEFAULT_NETWORK_MTU,
deprecated_name='segment_mtu', deprecated_group='ml2',
help=_('MTU of the underlying physical network. Neutron uses '
'this value to calculate MTU for all virtual network '

View File

@ -191,7 +191,7 @@ RPC_NAMESPACE_STATE = None
RPC_NAMESPACE_RESOURCES = None
# Default network MTU value when not configured
DEFAULT_NETWORK_MTU = 0
DEFAULT_NETWORK_MTU = 1500
IPV6_MIN_MTU = 1280
ROUTER_MARK_MASK = "0xffff"

View File

@ -16,6 +16,7 @@
from oslo_config import cfg
from neutron._i18n import _
from neutron.common import constants
ml2_opts = [
cfg.ListOpt('type_drivers',
@ -39,7 +40,7 @@ ml2_opts = [
"entrypoints to be loaded from the "
"neutron.ml2.extension_drivers namespace. "
"For example: extension_drivers = port_security,qos")),
cfg.IntOpt('path_mtu', default=1500,
cfg.IntOpt('path_mtu', default=constants.DEFAULT_NETWORK_MTU,
help=_('Maximum size of an IP packet (MTU) that can traverse '
'the underlying physical network infrastructure without '
'fragmentation. For instances using a '