When l2-pop ON, clean stale ports in table0 br-tun

When l2-pop is turned ON, the tunnels towards a
specific node are created and torn down by other nodes,
based on availability of ports on that specific node in
specific networks. This generally reclaims the resources
used for such tunnels in all the nodes.

Under such conditions, in the current code (without this
fix), the cleaned up ports continue to be present in
rules of table0 of br-tun, resulting in flow explosion.

This fix adds cleanup-logic to remove such rules that
continue to use l2-pop cleaned up ports, from table0 of
br-tun.

Change-Id: I2639ff6432a13320adcadbcc0841319a99ce8c24
Closes-Bug: #1318261
This commit is contained in:
Vivekanandan Narasimhan 2014-05-14 12:06:45 -07:00
parent b5d6c5e106
commit 3f9658dcd9
2 changed files with 10 additions and 9 deletions

View File

@ -1080,6 +1080,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
port_name = '%s-%s' % (tunnel_type,
self.get_ip_in_hex(remote_ip))
self.tun_br.delete_port(port_name)
self.tun_br.delete_flows(in_port=ofport)
self.tun_br_ofports[tunnel_type].pop(remote_ip, None)
def treat_devices_added_or_updated(self, devices, ovs_restarted):

View File

@ -624,19 +624,19 @@ class TestOvsNeutronAgent(base.BaseTestCase):
mock.patch.object(self.agent.tun_br, 'delete_flows'),
) as (mod_flow_fn, del_flow_fn):
self.agent.fdb_remove(None, fdb_entry)
del_flow_fn.assert_has_calls([
mock.call(table=constants.ARP_RESPONDER,
proto='arp',
dl_vlan='vlan2',
nw_dst=FAKE_IP1),
mock.call(table=constants.UCAST_TO_TUN,
dl_vlan='vlan2',
dl_dst=FAKE_MAC)
])
mod_flow_fn.assert_called_with(table=constants.FLOOD_TO_TUN,
dl_vlan='vlan2',
actions='strip_vlan,'
'set_tunnel:seg2,output:1')
expected = [mock.call(table=constants.ARP_RESPONDER,
proto='arp',
dl_vlan='vlan2',
nw_dst=FAKE_IP1),
mock.call(table=constants.UCAST_TO_TUN,
dl_vlan='vlan2',
dl_dst=FAKE_MAC),
mock.call(in_port='2')]
del_flow_fn.assert_has_calls(expected)
def test_fdb_add_port(self):
self._prepare_l2_pop_ofports()