diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index d0d033ca91..78c824566d 100644 --- a/orchagent/fdborch.cpp +++ b/orchagent/fdborch.cpp @@ -64,7 +64,6 @@ bool FdbOrch::bake() return true; } - bool FdbOrch::storeFdbEntryState(const FdbUpdate& update) { const FdbEntry& entry = update.entry; diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 8fd2c7a3b3..ca3c153fa4 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -6222,7 +6222,10 @@ bool PortsOrch::addTunnel(string tunnel_alias, sai_object_id_t tunnel_id, bool h { tunnel.m_learn_mode = SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DISABLE; } + + tunnel.m_oper_status = SAI_PORT_OPER_STATUS_DOWN; m_portList[tunnel_alias] = tunnel; + saiOidToAlias[tunnel_id] = tunnel_alias; SWSS_LOG_INFO("addTunnel:: %" PRIx64, tunnel_id); @@ -6233,6 +6236,7 @@ bool PortsOrch::removeTunnel(Port tunnel) { SWSS_LOG_ENTER(); + saiOidToAlias.erase(tunnel.m_tunnel_id); m_portList.erase(tunnel.m_alias); return true; @@ -6972,7 +6976,7 @@ void PortsOrch::updatePortOperStatus(Port &port, sai_port_oper_status_t status) return; } - if (port.m_type == Port::PHY) + if (port.m_type == Port::PHY || port.m_type == Port::TUNNEL) { updateDbPortOperStatus(port, status); updateGearboxPortOperStatus(port); diff --git a/orchagent/vxlanorch.cpp b/orchagent/vxlanorch.cpp index a1b149b870..207884b9b9 100644 --- a/orchagent/vxlanorch.cpp +++ b/orchagent/vxlanorch.cpp @@ -299,7 +299,7 @@ create_tunnel( num_map++; } } - + attr.id = SAI_TUNNEL_ATTR_DECAP_MAPPERS; attr.value.objlist.count = num_map; attr.value.objlist.list = map_list; @@ -1476,7 +1476,7 @@ bool VxlanTunnelOrch::removeVxlanTunnelMap(string tunnelName, uint32_t vni) return false; } - // Update the map count and if this is the last mapping entry + // Update the map count and if this is the last mapping entry // make SAI calls to delete the tunnel and tunnel termination objects. tunnel_obj->vlan_vrf_vni_count--; @@ -1654,6 +1654,7 @@ bool VxlanTunnelOrch::delTunnelUser(const std::string remote_vtep, uint32_t vni port_tunnel_name = getTunnelPortName(remote_vtep); gPortsOrch->getPort(port_tunnel_name,tunnelPort); + if ((vtep_ptr->getRemoteEndPointRefCnt(remote_vtep) == 1) && tunnelPort.m_fdb_count == 0) {