Skip to content

Commit

Permalink
Signed-off-by: Jaganathan Anbalagan <[email protected]>
Browse files Browse the repository at this point in the history
set host_tx_ready to false if gbsyncd SAI API fails.
  • Loading branch information
Jaganathan Anbalagan committed Jun 30, 2022
1 parent ed306d7 commit 3d44c37
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,10 @@ bool PortsOrch::setPortAdminStatus(Port &port, bool state)
}

bool gbstatus = setGearboxPortsAttr(port, SAI_PORT_ATTR_ADMIN_STATE, &state);
if (gbstatus != true)
{
m_portStateTable.hset(port.m_alias, "host_tx_ready", "false");
}

/* Update the state table for host_tx_ready*/
if (state && (gbstatus == true) && (status == SAI_STATUS_SUCCESS) )
Expand All @@ -1064,12 +1068,6 @@ bool PortsOrch::setPortAdminStatus(Port &port, bool state)
SWSS_LOG_INFO("Set admin status UP host_tx_ready to true to port pid:%" PRIx64,
port.m_port_id);
}
else
{
m_portStateTable.hset(port.m_alias, "host_tx_ready", "false");
SWSS_LOG_INFO("Set admin status %s host_tx_ready to false to port pid:%" PRIx64,
state ? "UP" : "DOWN", port.m_port_id);
}

return true;
}
Expand Down

0 comments on commit 3d44c37

Please sign in to comment.