When start ovs-agent, func tunnel_sync will call _setup_tunnel_port when l2_pop is not enabled.
For each tunnel _setup_tunnel_port will be called once, every call will add flood flows to br-tun. But one time call is enough.
def tunnel_sync(self):
LOG.debug("Configuring tunnel endpoints to other OVS agents")
try:
for tunnel_type in self.tunnel_types:
details = self.plugin_rpc.tunnel_sync(self.context,
self.local_ip,
tunnel_type,
self.conf.host)
if not self.l2_pop:
tunnels = details['tunnels']
for tunnel in tunnels:
if self.local_ip != tunnel['ip_address']:
remote_ip = tunnel['ip_address']
tun_name = self.get_tunnel_name(
tunnel_type, self.local_ip, remote_ip)
if tun_name is None:
continue
self._setup_tunnel_port(self.tun_br,
tun_name,
tunnel['ip_address'],
tunnel_type)
In _setup_tunnel_port, this code add flood flows:
if ofports and not self.l2_pop:
# Update flooding flows to include the new tunnel
for vlan_mapping in list(self.local_vlan_map.values()):
if vlan_mapping.network_type == tunnel_type:
br.install_flood_to_tun(vlan_mapping.vlan,
vlan_mapping.segmentation_id,
ofports)
Fix proposed to branch: master /review. openstack. org/326818
Review: https:/