Skip to content

Commit

Permalink
What I did
Browse files Browse the repository at this point in the history
Apply port speed again after disabling port AN.

In PortsOrch, when autonegotiation is disabled for a port, this PR ensures
that the port speed is updated correctly. If a new speed is configured while
autonegotiation is disabled, the new speed is applied; otherwise, the current
speed setting is reconfigured.

Why I did it
In PortsOrch, the port speed configuration will not be set to SAI when port AN is enabled.
Changing the port speed while port AN is enabled will not take effect after port AN is disabled.

In some chips, the port speed can not be modified when port AN is enabled.

How I verified it

Enable port AN.
Set port speed from speed1 to speed2
Disable port AN.
Make sure port speed is speed2 instead of speed1.
  • Loading branch information
PJHsieh authored and ecsonic committed Jul 8, 2024
1 parent 8f7c41a commit 2d56a7b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3515,6 +3515,7 @@ void PortsOrch::doPortTask(Consumer &consumer)

if (op == SET_COMMAND)
{
bool apply_port_speed_on_an_change_to_disabled = false;
auto &fvMap = m_portConfigMap[key];

for (const auto &cit : kfvFieldsValues(keyOpFieldsValues))
Expand Down Expand Up @@ -3722,6 +3723,18 @@ void PortsOrch::doPortTask(Consumer &consumer)
{
serdes_attr = p.m_preemphasis;
}

/* Reapply port speed after AN disabled */
if (p.m_autoneg < 1)
{
if (pCfg.speed.is_set != true)
{
pCfg.speed.is_set = true;
pCfg.speed.value = p.m_speed;
}
/* Force update speed even if p.m_speed == pCfg.speed.value */
apply_port_speed_on_an_change_to_disabled = true;
}
}
}

Expand Down Expand Up @@ -3781,7 +3794,7 @@ void PortsOrch::doPortTask(Consumer &consumer)

if (pCfg.speed.is_set)
{
if (p.m_speed != pCfg.speed.value)
if (p.m_speed != pCfg.speed.value || apply_port_speed_on_an_change_to_disabled)
{
if (!isSpeedSupported(p.m_alias, p.m_port_id, pCfg.speed.value))
{
Expand Down

0 comments on commit 2d56a7b

Please sign in to comment.