Merge "br_int: Make removal of DVR flows more strict" into stable/pike

This commit is contained in:
Zuul 2017-11-03 20:21:08 +00:00 committed by Gerrit Code Review
commit bd64409bbb
4 changed files with 33 additions and 10 deletions

View File

@ -134,7 +134,8 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
match = self._dvr_to_src_mac_match(ofp, ofpp,
vlan_tag=vlan_tag, dst_mac=dst_mac)
for table in (table_id, constants.TRANSIENT_TABLE):
self.uninstall_flows(table_id=table, match=match)
self.uninstall_flows(
strict=True, priority=4, table_id=table, match=match)
def add_dvr_mac_vlan(self, mac, port):
self.install_goto(table_id=constants.LOCAL_SWITCHING,

View File

@ -95,7 +95,9 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge):
def delete_dvr_to_src_mac(self, network_type, vlan_tag, dst_mac):
table_id = self._dvr_to_src_mac_table_id(network_type)
for table in (table_id, constants.TRANSIENT_TABLE):
self.delete_flows(table=table,
self.delete_flows(strict=True,
priority=4,
table=table,
dl_vlan=vlan_tag,
dl_dst=dst_mac)

View File

@ -195,11 +195,17 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
dst_mac=dst_mac)
(dp, ofp, ofpp) = self._get_dp()
expected = [
call.uninstall_flows(table_id=1,
call.uninstall_flows(
strict=True,
priority=4,
table_id=1,
match=ofpp.OFPMatch(
eth_dst=dst_mac,
vlan_vid=vlan_tag | ofp.OFPVID_PRESENT)),
call.uninstall_flows(table_id=60,
call.uninstall_flows(
strict=True,
priority=4,
table_id=60,
match=ofpp.OFPMatch(
eth_dst=dst_mac,
vlan_vid=vlan_tag | ofp.OFPVID_PRESENT)),
@ -257,11 +263,17 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
dst_mac=dst_mac)
(dp, ofp, ofpp) = self._get_dp()
expected = [
call.uninstall_flows(table_id=2,
call.uninstall_flows(
strict=True,
priority=4,
table_id=2,
match=ofpp.OFPMatch(
eth_dst=dst_mac,
vlan_vid=vlan_tag | ofp.OFPVID_PRESENT)),
call.uninstall_flows(table_id=60,
call.uninstall_flows(
strict=True,
priority=4,
table_id=60,
match=ofpp.OFPMatch(
eth_dst=dst_mac,
vlan_vid=vlan_tag | ofp.OFPVID_PRESENT)),

View File

@ -117,8 +117,12 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
vlan_tag=vlan_tag,
dst_mac=dst_mac)
expected = [
call.delete_flows(table=1, dl_dst=dst_mac, dl_vlan=vlan_tag),
call.delete_flows(table=60, dl_dst=dst_mac, dl_vlan=vlan_tag),
call.delete_flows(
strict=True, priority=4, table=1, dl_dst=dst_mac,
dl_vlan=vlan_tag),
call.delete_flows(
strict=True, priority=4, table=60, dl_dst=dst_mac,
dl_vlan=vlan_tag),
]
self.assertEqual(expected, self.mock.mock_calls)
@ -155,8 +159,12 @@ class OVSIntegrationBridgeTest(ovs_bridge_test_base.OVSBridgeTestBase):
vlan_tag=vlan_tag,
dst_mac=dst_mac)
expected = [
call.delete_flows(table=2, dl_dst=dst_mac, dl_vlan=vlan_tag),
call.delete_flows(table=60, dl_dst=dst_mac, dl_vlan=vlan_tag),
call.delete_flows(
strict=True, priority=4, table=2, dl_dst=dst_mac,
dl_vlan=vlan_tag),
call.delete_flows(
strict=True, priority=4, table=60, dl_dst=dst_mac,
dl_vlan=vlan_tag),
]
self.assertEqual(expected, self.mock.mock_calls)