Skip to content

Commit f83a97d

Browse files
committed
Ensure vlan network traffic is not centralized
This patch partly reverts the workaround introduced at [1]. In patch [1] the reside-on-redirect-chassis was forced for vlan provider networks to force centralized but not tunneled traffic for those network. In this patch we are making use of the "redirect-type" flag instead so that the traffic can be distributed and still not tunneled. This flag needs to be set on the router gateway port (port connecting the router to the external network) unlike the previous one that was set on the router interface port (port connecting the (vlan) internal network to the router). In this patch we are setting it on all ovn gateway ports if DVR is enabled, as: - It is needed for vlan (provider) network to have their traffic distributed instead of tunneled to the controller where the cr-lrp is associated - It is not having any effect on the geneve tenant networks as it only applies to network that has a localnet port associated to them. [1] https://review.opendev.org/c/openstack/neutron/+/871252 Closes-Bug: #2003455 Change-Id: Ia05416df88904e864d4fc9760ffcdc97a4651f9f (cherry picked from commit 8e3bddb)
1 parent 4529b5b commit f83a97d

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

neutron/common/ovn/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@
372372
LSP_OPTIONS_MCAST_FLOOD = 'mcast_flood'
373373

374374
LRP_OPTIONS_RESIDE_REDIR_CH = 'reside-on-redirect-chassis'
375+
LRP_OPTIONS_REDIRECT_TYPE = 'redirect-type'
376+
BRIDGE_REDIRECT_TYPE = "bridged"
375377

376378
# Port Binding types
377379
PB_TYPE_VIRTUAL = 'virtual'

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,7 @@ 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-
# 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)]
834+
vlan_net_ids = [vn['id'] for vn in vlan_nets]
838835
router_ports = self._ovn_client._plugin.get_ports(
839836
context, {'network_id': vlan_net_ids,
840837
'device_owner': n_const.ROUTER_PORT_OWNERS})

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,21 +1554,29 @@ def _gen_router_port_options(self, port, network=None):
15541554
if network is None:
15551555
network = self._plugin.get_network(admin_context,
15561556
port['network_id'])
1557+
15571558
# For VLAN type networks we need to set the
15581559
# "reside-on-redirect-chassis" option so the routing for this
15591560
# logical router port is centralized in the chassis hosting the
15601561
# distributed gateway port.
15611562
# https://github.com/openvswitch/ovs/commit/85706c34d53d4810f54bec1de662392a3c06a996
1562-
# FIXME(ltomasbo): Once Bugzilla 2162756 is fixed the
1563-
# is_provider_network check should be removed
15641563
if network.get(pnet.NETWORK_TYPE) == const.TYPE_VLAN:
15651564
options[ovn_const.LRP_OPTIONS_RESIDE_REDIR_CH] = (
1566-
'false' if (ovn_conf.is_ovn_distributed_floating_ip() and
1567-
not utils.is_provider_network(network))
1565+
'false' if ovn_conf.is_ovn_distributed_floating_ip()
15681566
else 'true')
15691567

15701568
is_gw_port = const.DEVICE_OWNER_ROUTER_GW == port.get(
15711569
'device_owner')
1570+
1571+
# NOTE(ltomasbo): For VLAN type networks connected through the gateway
1572+
# port there is a need to set the redirect-type option to bridge to
1573+
# ensure traffic is not centralized through the controller.
1574+
# For geneve based tenant networks it won't have any effect as it only
1575+
# applies to network with a localnet associated to it
1576+
if is_gw_port and ovn_conf.is_ovn_distributed_floating_ip():
1577+
options[ovn_const.LRP_OPTIONS_REDIRECT_TYPE] = (
1578+
ovn_const.BRIDGE_REDIRECT_TYPE)
1579+
15721580
if is_gw_port and ovn_conf.is_ovn_emit_need_to_frag_enabled():
15731581
try:
15741582
router_ports = self._get_router_ports(admin_context,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
fixes:
3+
- |
4+
[`bug 2003455 <https://bugs.launchpad.net/neutron/+bug/2003455>`_]
5+
Previous commit (https://review.opendev.org/c/openstack/neutron/+/871252)
6+
added a workaround to avoid vlan provider networks traffic to be tunneled
7+
to the compute nodes but it was still centralized. Now the traffic is
8+
distributed thanks to using the "redirect-type" flag on the ovn gateway
9+
port.

0 commit comments

Comments
 (0)