[OVN] Disable mcast_flood on localnet ports

The mcast_flood option will unconditionally forward multicast traffic
for that port, this behavior is not desired and results in duplicated
traffic being sent to the same port. This patch disables that behavior
by setting the mcast_flood option for the localnet ports to False.

Note that, a similar option called "mcast_flood_reports" is still
enabled because we do want to have the multicast reports being sent but
not normal traffic.

Change-Id: I8033e12f5b30e3ecc9143431543266a890fe4073
Closes-Bug: #1933207
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
(cherry picked from commit 953eb92a4f)
This commit is contained in:
Lucas Alvares Gomes 2021-06-22 10:54:13 +01:00
parent 7a70a0ae35
commit 2c9803a8b4
4 changed files with 6 additions and 6 deletions

View File

@ -664,7 +664,7 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
options.update({ovn_const.LSP_OPTIONS_MCAST_FLOOD_REPORTS: 'true'})
if port_type == ovn_const.LSP_TYPE_LOCALNET:
options.update({ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'true'})
options.update({ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'false'})
cmds.append(self._nb_idl.lsp_set_options(port.name, **options))

View File

@ -1580,7 +1580,7 @@ class OVNClient(object):
physnet = segment.get(segment_def.PHYSICAL_NETWORK)
options = {'network_name': physnet,
ovn_const.LSP_OPTIONS_MCAST_FLOOD_REPORTS: 'true',
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'true'}
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'false'}
cmd = self._nb_idl.create_lswitch_port(
lport_name=utils.ovn_provnet_port_name(segment['id']),
lswitch_name=utils.ovn_name(network_id),

View File

@ -429,6 +429,6 @@ class TestDBInconsistenciesPeriodics(testlib_api.SqlTestCaseLight,
# and type "" or localnet)
expected_calls = [
mock.call('lsp1', mcast_flood_reports='true'),
mock.call('lsp5', mcast_flood_reports='true', mcast_flood='true')]
mock.call('lsp5', mcast_flood_reports='true', mcast_flood='false')]
nb_idl.lsp_set_options.assert_has_calls(expected_calls)

View File

@ -672,7 +672,7 @@ class TestOVNMechanismDriver(test_plugin.Ml2PluginV2TestCase):
lswitch_name=ovn_utils.ovn_name(net['id']),
options={'network_name': 'physnet1',
ovn_const.LSP_OPTIONS_MCAST_FLOOD_REPORTS: 'true',
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'true'},
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'false'},
tag=2,
type='localnet')
@ -2078,7 +2078,7 @@ class TestOVNMechanismDriverSegment(test_segment.HostSegmentMappingTestCase):
lswitch_name=ovn_utils.ovn_name(net['id']),
options={'network_name': 'phys_net1',
ovn_const.LSP_OPTIONS_MCAST_FLOOD_REPORTS: 'true',
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'true'},
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'false'},
tag=200,
type='localnet')
ovn_nb_api.create_lswitch_port.reset_mock()
@ -2092,7 +2092,7 @@ class TestOVNMechanismDriverSegment(test_segment.HostSegmentMappingTestCase):
lswitch_name=ovn_utils.ovn_name(net['id']),
options={'network_name': 'phys_net2',
ovn_const.LSP_OPTIONS_MCAST_FLOOD_REPORTS: 'true',
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'true'},
ovn_const.LSP_OPTIONS_MCAST_FLOOD: 'false'},
tag=300,
type='localnet')
segments = segments_db.get_network_segments(