diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index 03c854fee3..c0184623cd 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 96aa7d9f80..f649ab1e40 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -6788,7 +6788,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); @@ -6799,6 +6802,7 @@ bool PortsOrch::removeTunnel(Port tunnel) { SWSS_LOG_ENTER(); + saiOidToAlias.erase(tunnel.m_tunnel_id); m_portList.erase(tunnel.m_alias); return true; @@ -7671,7 +7675,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); updateDbPortFlapCount(port, status); diff --git a/orchagent/vxlanorch.cpp b/orchagent/vxlanorch.cpp index d2c36d91d4..72c89c0b72 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; @@ -1473,7 +1473,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--; @@ -1651,6 +1651,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) {