Skip to content

Commit

Permalink
validate AN cap only when there is an update to AN config
Browse files Browse the repository at this point in the history
Signed-off-by: Dante Su <[email protected]>
  • Loading branch information
ds952811 committed Jul 13, 2022
1 parent baa41e0 commit 056a5c2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 056a5c2

Please sign in to comment.