]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
When l2-pop ON, clean stale ports in table0 br-tun
authorVivekanandan Narasimhan <vivekanandan.narasimhan@hp.com>
Wed, 14 May 2014 19:06:45 +0000 (12:06 -0700)
committerVivekanandan Narasimhan <vivekanandan.narasimhan@hp.com>
Thu, 12 Jun 2014 06:02:11 +0000 (23:02 -0700)
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

neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py

index f42a2911353f1357314a1960b78d958eebdce55f..6c5fb56bbc8866be7807493c6cc814efb84ec84e 100644 (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):
index 79fdf08c47b888f1b25a4569c6f86cc1929c6894..b1d2371b3b1254ff79d3df0eaf7a8788b2a6daa4 100644 (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()