Skip to content

Commit

Permalink
Signed-off-by: Jaganathan Anbalagan <jaganbal@cisco.com>
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 Jul 13, 2022
1 parent f285b73 commit f6122a9
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 @@ -1094,6 +1094,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 @@ -1102,12 +1106,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 f6122a9

Please sign in to comment.