From 774f13feaf7f300d241c933c63090c1d31e26cb4 Mon Sep 17 00:00:00 2001 From: PJHsieh <49477291+PJHsieh@users.noreply.github.com> Date: Thu, 2 May 2024 06:11:58 +0000 Subject: [PATCH] Ensure port speed update upon autonegotiation disablement In PortsOrch, when autonegotiation is disabled for a port, this commit 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. --- orchagent/portsorch.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 653d535537..bdc98cb530 100644 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -4115,8 +4115,12 @@ void PortsOrch::doPortTask(Consumer &consumer) /* Reapply port speed after AN disabled */ if (p.m_autoneg < 1) { - pCfg.speed.is_set = true; - pCfg.speed.value = p.m_speed; + 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; } }