From 056a5c224f83711fb8a4ebb661cdfcd9c1f496b5 Mon Sep 17 00:00:00 2001 From: Dante Su Date: Wed, 13 Jul 2022 07:10:06 +0000 Subject: [PATCH] validate AN cap only when there is an update to AN config Signed-off-by: Dante Su --- orchagent/portsorch.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index d80b7142b1..b7f47a67b3 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -3107,21 +3107,21 @@ void PortsOrch::doPortTask(Consumer &consumer) it = consumer.m_toSync.erase(it); continue; } - if (p.m_cap_an < 0) - { - initPortCapAutoNeg(p); - m_portList[alias] = p; - } - if (p.m_cap_an < 1) - { - SWSS_LOG_ERROR("%s: autoneg is not supported (cap=%d)", p.m_alias.c_str(), p.m_cap_an); - // autoneg is not supported, don't retry - it = consumer.m_toSync.erase(it); - continue; - } an = autoneg_mode_map[an_str]; if (an != p.m_autoneg) { + if (p.m_cap_an < 0) + { + initPortCapAutoNeg(p); + m_portList[alias] = p; + } + if (p.m_cap_an < 1) + { + SWSS_LOG_ERROR("%s: autoneg is not supported (cap=%d)", p.m_alias.c_str(), p.m_cap_an); + // autoneg is not supported, don't retry + it = consumer.m_toSync.erase(it); + continue; + } if (p.m_admin_state_up) { /* Bring port down before applying speed */ @@ -3178,7 +3178,7 @@ void PortsOrch::doPortTask(Consumer &consumer) } if (p.m_cap_lt < 1) { - SWSS_LOG_WARN("%s: LT is not supported by the ASIC", alias.c_str()); + SWSS_LOG_WARN("%s: LT is not supported(cap=%d)", alias.c_str(), p.m_cap_lt); // Don't retry it = consumer.m_toSync.erase(it); continue;