diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 51f4552574..fb5bc1b694 100644 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -1639,19 +1639,10 @@ void PortsOrch::doPortTask(Consumer &consumer) getPortSpeed(it->second, port_speed); if ((m_lanesAliasSpeedMap.find(it->first) == m_lanesAliasSpeedMap.end()) || (get<1>(is->second) != port_speed)) { - char *platform = getenv("platform"); - if (platform && (strstr(platform, BFN_PLATFORM_SUBSTRING) || strstr(platform, MLNX_PLATFORM_SUBSTRING) || strstr(platform, INVM_PLATFORM_SUBSTRING))) + if (!removePort(it->second)) { - if (!removePort(it->second)) - { - throw runtime_error("PortsOrch initialization failure."); - } - } - else - { - SWSS_LOG_NOTICE("Failed to remove Port %" PRIx64 " due to missing SAI remove_port API.", it->second); + throw runtime_error("PortsOrch initialization failure."); } - it = m_portListLaneMap.erase(it); } else @@ -1666,22 +1657,11 @@ void PortsOrch::doPortTask(Consumer &consumer) if (m_portListLaneMap.find(it->first) == m_portListLaneMap.end()) { - // work around to avoid syncd termination on SAI error due missing create_port SAI API - // can be removed when SAI redis return NotImplemented error - char *platform = getenv("platform"); - if (platform && (strstr(platform, BFN_PLATFORM_SUBSTRING) || strstr(platform, MLNX_PLATFORM_SUBSTRING) || strstr(platform, INVM_PLATFORM_SUBSTRING))) + if (!addPort(it->first, get<1>(it->second), get<2>(it->second), get<3>(it->second))) { - if (!addPort(it->first, get<1>(it->second), get<2>(it->second), get<3>(it->second))) - { - throw runtime_error("PortsOrch initialization failure."); - } - - port_created = true; - } - else - { - SWSS_LOG_NOTICE("Failed to create Port %s due to missing SAI create_port API.", get<0>(it->second).c_str()); + throw runtime_error("PortsOrch initialization failure."); } + port_created = true; } else { @@ -2745,7 +2725,7 @@ bool PortsOrch::removeVlan(Port vlan) SWSS_LOG_ENTER(); if (m_port_ref_count[vlan.m_alias] > 0) { - SWSS_LOG_ERROR("Failed to remove ref count %d VLAN %s", + SWSS_LOG_ERROR("Failed to remove ref count %d VLAN %s", m_port_ref_count[vlan.m_alias], vlan.m_alias.c_str()); return false; @@ -2929,8 +2909,8 @@ bool PortsOrch::removeLag(Port lag) if (m_port_ref_count[lag.m_alias] > 0) { - SWSS_LOG_ERROR("Failed to remove ref count %d LAG %s", - m_port_ref_count[lag.m_alias], + SWSS_LOG_ERROR("Failed to remove ref count %d LAG %s", + m_port_ref_count[lag.m_alias], lag.m_alias.c_str()); return false; }