Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2358,17 +2358,45 @@ void PortsOrch::doPortTask(Consumer &consumer)
/* reset fec mode upon mode change */
if (p.m_fec_mode != fec_mode_map[fec_mode])
{
p.m_fec_mode = fec_mode_map[fec_mode];
if (setPortFec(p, p.m_fec_mode))
if (p.m_admin_state_up)
{
m_portList[alias] = p;
SWSS_LOG_NOTICE("Set port %s fec to %s", alias.c_str(), fec_mode.c_str());
/* Bring port down before applying fec mode*/
if (!setPortAdminStatus(p, false))
{
SWSS_LOG_ERROR("Failed to set port %s admin status DOWN to set fec mode", alias.c_str());
it++;
continue;
}

p.m_admin_state_up = false;
p.m_fec_mode = fec_mode_map[fec_mode];

if (setPortFec(p, p.m_fec_mode))
{
m_portList[alias] = p;
SWSS_LOG_NOTICE("Set port %s fec to %s", alias.c_str(), fec_mode.c_str());
}
else
{
SWSS_LOG_ERROR("Failed to set port %s fec to %s", alias.c_str(), fec_mode.c_str());
it++;
continue;
}
}
else
{
SWSS_LOG_ERROR("Failed to set port %s fec to %s", alias.c_str(), fec_mode.c_str());
it++;
continue;
/* Port is already down, setting fec mode*/
if (setPortFec(p, p.m_fec_mode))
{
m_portList[alias] = p;
SWSS_LOG_NOTICE("Set port %s fec to %s", alias.c_str(), fec_mode.c_str());
}
else
{
SWSS_LOG_ERROR("Failed to set port %s fec to %s", alias.c_str(), fec_mode.c_str());
it++;
continue;
}
}
}
}
Expand Down