]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
OVS plugin tunnel bridges never learn
authorAaron Rosen <arosen@nicira.com>
Thu, 5 Jul 2012 23:31:51 +0000 (19:31 -0400)
committerGerrit Code Review <review@openstack.org>
Wed, 22 Aug 2012 20:07:49 +0000 (20:07 +0000)
This patch installs a flow_mod to handle each vm
with the normal action which allows OVS to do mac learning.
Fixes bug 1011467

Change-Id: Ib6500813d4111ae42675459fac64dfb2e9c40d91

quantum/plugins/openvswitch/agent/ovs_quantum_agent.py
quantum/plugins/openvswitch/tests/unit/test_tunnel.py

index 9e89be82b448e39075f4e455e3b1c7e4be0f239a..cf0f6d16f6678a068cdf5b6a25cc03453b9ff4a9 100755 (executable)
@@ -478,10 +478,10 @@ class OVSQuantumTunnelAgent(object):
         # outbound
         self.tun_br.add_flow(priority=4, in_port=self.patch_int_ofport,
                              dl_vlan=lvid,
-                             actions="strip_vlan,set_tunnel:%s,normal" %
-                             (lsw_id))
-        # inbound
+                             actions="set_tunnel:%s,normal" % lsw_id)
+        # inbound bcast/mcast
         self.tun_br.add_flow(priority=3, tun_id=lsw_id,
+                             dl_dst="01:00:00:00:00:00/01:00:00:00:00:00",
                              actions="mod_vlan_vid:%s,output:%s" %
                              (lvid, self.patch_int_ofport))
 
@@ -510,6 +510,10 @@ class OVSQuantumTunnelAgent(object):
         lvm = self.local_vlan_map[net_uuid]
         lvm.vif_ids.append(port.vif_id)
 
+        # inbound unicast
+        self.tun_br.add_flow(priority=3, tun_id=lsw_id, dl_dst=port.vif_mac,
+                             actions="mod_vlan_vid:%s,normal" % lvm.vlan)
+
         self.int_br.set_db_attribute("Port", port.port_name, "tag",
                                      str(lvm.vlan))
         if int(port.ofport) != -1:
index 58563a03b13de22f68312333bd39a1c758bf1103..8a0eeb3dbeab8c938d35d42cbef495e6de1a8d9b 100644 (file)
@@ -34,6 +34,7 @@ VIF_MAC = '3c:09:24:1e:78:23'
 OFPORT_NUM = 1
 VIF_PORT = ovs_lib.VifPort('port', OFPORT_NUM,
                            VIF_ID, VIF_MAC, 'switch')
+BCAST_MAC = "01:00:00:00:00:00/01:00:00:00:00:00"
 
 
 class DummyPort:
@@ -85,13 +86,13 @@ class TunnelTest(unittest.TestCase):
         self.mox.VerifyAll()
 
     def testProvisionLocalVlan(self):
-        action_string = 'strip_vlan,set_tunnel:%s,normal' % LS_ID
+        action_string = 'set_tunnel:%s,normal' % LS_ID
         self.mock_tun_bridge.add_flow(priority=4, in_port=self.INT_OFPORT,
                                       dl_vlan=LV_ID, actions=action_string)
 
         action_string = 'mod_vlan_vid:%s,output:%s' % (LV_ID, self.INT_OFPORT)
         self.mock_tun_bridge.add_flow(priority=3, tun_id=LS_ID,
-                                      actions=action_string)
+                                      dl_dst=BCAST_MAC, actions=action_string)
 
         self.mox.ReplayAll()
 
@@ -124,6 +125,11 @@ class TunnelTest(unittest.TestCase):
                                               'tag', str(LVM.vlan))
         self.mock_int_bridge.delete_flows(in_port=VIF_PORT.ofport)
 
+        action_string = 'mod_vlan_vid:%s,normal' % LV_ID
+        self.mock_tun_bridge.add_flow(priority=3, tun_id=LS_ID,
+                                      dl_dst=VIF_PORT.vif_mac,
+                                      actions=action_string)
+
         self.mox.ReplayAll()
         a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                     self.TUN_BRIDGE,