Skip to content

Commit 334f773

Browse files
committed
[OVN] Ensure traffic for provider vlan networks is not tunneled
This patch adds an extra checking to ensure the "reside-on-redirect-chassis" is set to true for the logical router port associated to vlan provider network despite having the "ovn_distributed_floating_ip" enabled or not. This is needed as there is an OVN bug [1] making it not work as expected. Note setting this to true has implications as the traffic will be centrallized (but not tunneled) through the node with the gateway port. The expected behavior of this flag, once [1] is fixed is: - reside-on-redirect-chassis flag to False: means traffic goes tunneled to the controller with the gateway port. Means it requires extra MTU reduction to work. - reside-on-redirect-chassis flag to True: means traffic is not tunneled to the controller with the gateway port, but the traffic is centralized through the controller with the gateway port. Thus it does not require extra MTU reduction. - reside-on-redirect-chassis to False, but with ovn-chassis-mac-mappings configured: means the traffic is fully distributed and it is not being tunneled, nor sent, through the controller with the gateway port. This is the preferred option as it does not require MTU reduction and it avoids the extra hop. However it is not working as expected, therefore the fallback to set reside-on-redirect-chassis to True. [1] https://bugzilla.redhat.com/show_bug.cgi?id=2162756 Closes-Bug: #2003455 Change-Id: I662cb30c842e54bb9f7dabac5519283aa7c7f8d0 (cherry picked from commit acb809e)
1 parent f8f9f1b commit 334f773

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

neutron/common/ovn/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from neutron_lib.api.definitions import l3
2222
from neutron_lib.api.definitions import port_security as psec
2323
from neutron_lib.api.definitions import portbindings
24+
from neutron_lib.api.definitions import provider_net
2425
from neutron_lib.api import validators
2526
from neutron_lib import constants as const
2627
from neutron_lib import context as n_context
@@ -610,6 +611,10 @@ def is_gateway_chassis_invalid(chassis_name, gw_chassis,
610611

611612

612613
def is_provider_network(network):
614+
return network.get(provider_net.PHYSICAL_NETWORK, False)
615+
616+
617+
def is_external_network(network):
613618
return network.get(external_net.EXTERNAL, False)
614619

615620

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/maintenance.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,10 @@ def check_vlan_distributed_ports(self):
831831
# Get router ports belonging to VLAN networks
832832
vlan_nets = self._ovn_client._plugin.get_networks(
833833
context, {pnet.NETWORK_TYPE: [n_const.TYPE_VLAN]})
834-
vlan_net_ids = [vn['id'] for vn in vlan_nets]
834+
# FIXME(ltomasbo): Once Bugzilla 2162756 is fixed the
835+
# is_provider_network check should be removed
836+
vlan_net_ids = [vn['id'] for vn in vlan_nets
837+
if not utils.is_provider_network(vn)]
835838
router_ports = self._ovn_client._plugin.get_ports(
836839
context, {'network_id': vlan_net_ids,
837840
'device_owner': n_const.ROUTER_PORT_OWNERS})

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ def _get_nets_and_ipv6_ra_confs_for_router_port(self, context, port):
12471247
# leak the RAs generated for the tenant networks via the
12481248
# provider network
12491249
ipv6_ra_configs['send_periodic'] = 'true'
1250-
if is_gw_port and utils.is_provider_network(net):
1250+
if is_gw_port and utils.is_external_network(net):
12511251
ipv6_ra_configs['send_periodic'] = 'false'
12521252
ipv6_ra_configs['mtu'] = str(net['mtu'])
12531253

@@ -1559,9 +1559,12 @@ def _gen_router_port_options(self, port, network=None):
15591559
# logical router port is centralized in the chassis hosting the
15601560
# distributed gateway port.
15611561
# https://github.com/openvswitch/ovs/commit/85706c34d53d4810f54bec1de662392a3c06a996
1562+
# FIXME(ltomasbo): Once Bugzilla 2162756 is fixed the
1563+
# is_provider_network check should be removed
15621564
if network.get(pnet.NETWORK_TYPE) == const.TYPE_VLAN:
15631565
options[ovn_const.LRP_OPTIONS_RESIDE_REDIR_CH] = (
1564-
'false' if ovn_conf.is_ovn_distributed_floating_ip()
1566+
'false' if (ovn_conf.is_ovn_distributed_floating_ip() and
1567+
not utils.is_provider_network(network))
15651568
else 'true')
15661569

15671570
is_gw_port = const.DEVICE_OWNER_ROUTER_GW == port.get(
@@ -1976,8 +1979,9 @@ def update_network(self, context, network, original_network=None):
19761979
for subnet in subnets:
19771980
self.update_subnet(context, subnet, network, txn)
19781981

1979-
if utils.is_provider_network(network):
1980-
# make sure to use admin context as this is a providernet
1982+
if utils.is_external_network(network):
1983+
# make sure to use admin context as this is a external
1984+
# network
19811985
self.set_gateway_mtu(n_context.get_admin_context(),
19821986
network, txn)
19831987

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
fixes:
3+
- |
4+
[`bug 2003455 <https://bugs.launchpad.net/neutron/+bug/2003455>`_]
5+
It is added an extra checking to ensure the "reside-on-redirect-chassis"
6+
is set to true for the logical router port associated to vlan provider
7+
network despite having the "ovn_distributed_floating_ip" enabled or not.
8+
This is needed as there is an OVN bug
9+
(https://bugzilla.redhat.com/show_bug.cgi?id=2162756) making it not work
10+
as expected. Until that is fixed, we need these workaround
11+
that makes the traffic centrallized, but not tunneled, through the node
12+
with the gateway port, thus avoiding MTU issues.
13+
issues:
14+
- |
15+
Until the OVN bug (https://bugzilla.redhat.com/show_bug.cgi?id=2162756)
16+
is fixed, setting the "reside-on-redirect-chassis" to true for the logical
17+
router port associated to vlan provider network is needed. This workaround
18+
makes the traffic centrallized, but not tunneled, through the node
19+
with the gateway port, thus avoiding MTU issues.

0 commit comments

Comments
 (0)