OVS plugin tunnel bridges never learn

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
This commit is contained in:
Aaron Rosen 2012-07-05 19:31:51 -04:00 committed by Gerrit Code Review
parent 9c915b0d7f
commit d2b58ba486
2 changed files with 15 additions and 5 deletions

View File

@ -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:

View 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,