From 7b5c7dce53ab9e9778d1d72fcbbed565bfce65bd Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 15 Jul 2016 20:17:13 +0200 Subject: [PATCH] Introduce PUBLIC_BRIDGE_MTU variable to set br-ex MTU This variable can be used to accommodate for underlying infrastructure that does not provide full 1500-sized traffic, or maybe instead gives access to Jumbo frames. Change-Id: I38a80bac18673a30842a7b997d0669fed5aff976 Related-Bug: #1603268 --- functions | 9 +++++++++ lib/neutron_plugins/linuxbridge_agent | 1 + lib/neutron_plugins/openvswitch_agent | 2 +- lib/neutron_plugins/ovs_base | 7 ++++++- lib/neutron_plugins/services/l3 | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/functions b/functions index 4f5e10aaa6..58565788ff 100644 --- a/functions +++ b/functions @@ -637,6 +637,15 @@ function create_disk { fi } + +# set_mtu - Set MTU on a device +function set_mtu { + local dev=$1 + local mtu=$2 + sudo ip link set mtu $mtu dev $dev +} + + # Restore xtrace $_XTRACE_FUNCTIONS diff --git a/lib/neutron_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent index 0a066354ca..e5a7b76187 100644 --- a/lib/neutron_plugins/linuxbridge_agent +++ b/lib/neutron_plugins/linuxbridge_agent @@ -50,6 +50,7 @@ function neutron_plugin_configure_dhcp_agent { function neutron_plugin_configure_l3_agent { local conf_file=$1 sudo brctl addbr $PUBLIC_BRIDGE + set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU iniset $conf_file DEFAULT external_network_bridge iniset $conf_file DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport } diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent index 69e38f4df1..b4a53e4c38 100644 --- a/lib/neutron_plugins/openvswitch_agent +++ b/lib/neutron_plugins/openvswitch_agent @@ -104,7 +104,7 @@ function neutron_plugin_configure_plugin_agent { sudo ovs-vsctl -- --may-exist add-port "br-$VLAN_INTERFACE" $VLAN_INTERFACE # Create external bridge and add port - _neutron_ovs_base_add_bridge $PUBLIC_BRIDGE + _neutron_ovs_base_add_public_bridge sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $PUBLIC_INTERFACE # Set bridge mappings to "physnet1:br-$GUEST_INTERFACE_DEFAULT" diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base index ecf252f88b..9e1421f5e6 100644 --- a/lib/neutron_plugins/ovs_base +++ b/lib/neutron_plugins/ovs_base @@ -105,11 +105,16 @@ function _neutron_ovs_base_configure_l3_agent { sudo ip link set $Q_PUBLIC_VETH_EX up sudo ip addr flush dev $Q_PUBLIC_VETH_EX else - _neutron_ovs_base_add_bridge $PUBLIC_BRIDGE + _neutron_ovs_base_add_public_bridge sudo ovs-vsctl br-set-external-id $PUBLIC_BRIDGE bridge-id $PUBLIC_BRIDGE fi } +function _neutron_ovs_base_add_public_bridge { + _neutron_ovs_base_add_bridge $PUBLIC_BRIDGE + set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU +} + function _neutron_ovs_base_configure_nova_vif_driver { : } diff --git a/lib/neutron_plugins/services/l3 b/lib/neutron_plugins/services/l3 index 4ce87bdf6f..2180099ee4 100644 --- a/lib/neutron_plugins/services/l3 +++ b/lib/neutron_plugins/services/l3 @@ -15,6 +15,7 @@ IPV6_PROVIDER_FIXED_RANGE=${IPV6_PROVIDER_FIXED_RANGE:-} IPV6_PROVIDER_NETWORK_GATEWAY=${IPV6_PROVIDER_NETWORK_GATEWAY:-} PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex} +PUBLIC_BRIDGE_MTU=${PUBLIC_BRIDGE_MTU:-1500} # If Q_USE_PUBLIC_VETH=True, create and use a veth pair instead of # PUBLIC_BRIDGE. This is intended to be used with