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:
parent
9c915b0d7f
commit
d2b58ba486
@ -478,10 +478,10 @@ class OVSQuantumTunnelAgent(object):
|
|||||||
# outbound
|
# outbound
|
||||||
self.tun_br.add_flow(priority=4, in_port=self.patch_int_ofport,
|
self.tun_br.add_flow(priority=4, in_port=self.patch_int_ofport,
|
||||||
dl_vlan=lvid,
|
dl_vlan=lvid,
|
||||||
actions="strip_vlan,set_tunnel:%s,normal" %
|
actions="set_tunnel:%s,normal" % lsw_id)
|
||||||
(lsw_id))
|
# inbound bcast/mcast
|
||||||
# inbound
|
|
||||||
self.tun_br.add_flow(priority=3, tun_id=lsw_id,
|
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" %
|
actions="mod_vlan_vid:%s,output:%s" %
|
||||||
(lvid, self.patch_int_ofport))
|
(lvid, self.patch_int_ofport))
|
||||||
|
|
||||||
@ -510,6 +510,10 @@ class OVSQuantumTunnelAgent(object):
|
|||||||
lvm = self.local_vlan_map[net_uuid]
|
lvm = self.local_vlan_map[net_uuid]
|
||||||
lvm.vif_ids.append(port.vif_id)
|
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",
|
self.int_br.set_db_attribute("Port", port.port_name, "tag",
|
||||||
str(lvm.vlan))
|
str(lvm.vlan))
|
||||||
if int(port.ofport) != -1:
|
if int(port.ofport) != -1:
|
||||||
|
@ -34,6 +34,7 @@ VIF_MAC = '3c:09:24:1e:78:23'
|
|||||||
OFPORT_NUM = 1
|
OFPORT_NUM = 1
|
||||||
VIF_PORT = ovs_lib.VifPort('port', OFPORT_NUM,
|
VIF_PORT = ovs_lib.VifPort('port', OFPORT_NUM,
|
||||||
VIF_ID, VIF_MAC, 'switch')
|
VIF_ID, VIF_MAC, 'switch')
|
||||||
|
BCAST_MAC = "01:00:00:00:00:00/01:00:00:00:00:00"
|
||||||
|
|
||||||
|
|
||||||
class DummyPort:
|
class DummyPort:
|
||||||
@ -85,13 +86,13 @@ class TunnelTest(unittest.TestCase):
|
|||||||
self.mox.VerifyAll()
|
self.mox.VerifyAll()
|
||||||
|
|
||||||
def testProvisionLocalVlan(self):
|
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,
|
self.mock_tun_bridge.add_flow(priority=4, in_port=self.INT_OFPORT,
|
||||||
dl_vlan=LV_ID, actions=action_string)
|
dl_vlan=LV_ID, actions=action_string)
|
||||||
|
|
||||||
action_string = 'mod_vlan_vid:%s,output:%s' % (LV_ID, self.INT_OFPORT)
|
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,
|
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()
|
self.mox.ReplayAll()
|
||||||
|
|
||||||
@ -124,6 +125,11 @@ class TunnelTest(unittest.TestCase):
|
|||||||
'tag', str(LVM.vlan))
|
'tag', str(LVM.vlan))
|
||||||
self.mock_int_bridge.delete_flows(in_port=VIF_PORT.ofport)
|
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()
|
self.mox.ReplayAll()
|
||||||
a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
|
a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
|
||||||
self.TUN_BRIDGE,
|
self.TUN_BRIDGE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user