Skip to content

Commit

Permalink
drop LT capability query
Browse files Browse the repository at this point in the history
Signed-off-by: Dante Su <dante.su@broadcom.com>
  • Loading branch information
ds952811 committed May 19, 2022
1 parent 55ced7d commit 876e605
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
1 change: 0 additions & 1 deletion orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class Port
bool m_an_cfg = false;

int m_cap_an = -1; /* Capability - AutoNeg, -1 means not set */
int m_cap_lt = -1; /* Capability - LinkTraining, -1 means not set */
};

}
Expand Down
33 changes: 1 addition & 32 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,24 +1949,6 @@ void PortsOrch::initPortCapAutoNeg(Port &port)
}
}

void PortsOrch::initPortCapLinkTraining(Port &port)
{
sai_status_t status;
sai_attribute_t attr;

attr.id = SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE;
status = sai_port_api->get_port_attribute(port.m_port_id, 1, &attr);
if (status == SAI_STATUS_SUCCESS)
{
port.m_cap_lt = attr.value.booldata ? 1 : 0;
}
else
{
port.m_cap_lt = 0;
SWSS_LOG_NOTICE("Unable to get %s LT capability", port.m_alias.c_str());
}
}

/*
* If Gearbox is enabled and this is a Gearbox port then set the attributes accordingly.
*/
Expand Down Expand Up @@ -3136,19 +3118,6 @@ void PortsOrch::doPortTask(Consumer &consumer)
lt = link_training_mode_map[lt_str];
if (lt != p.m_link_training)
{
if (p.m_cap_lt < 0)
{
initPortCapLinkTraining(p);
m_portList[alias] = p;
}
if (p.m_cap_lt < 1)
{
SWSS_LOG_WARN("%s: LT is not supported by the ASIC", alias.c_str());
// Don't retry
it = consumer.m_toSync.erase(it);
continue;
}

auto status = setPortLinkTraining(p, lt > 0 ? true : false);
if (status != task_success)
{
Expand Down Expand Up @@ -7257,7 +7226,7 @@ void PortsOrch::updatePortStateLinkTraining(const Port &port)

string status = "off";

if ((port.m_link_training > 0) && (port.m_cap_lt > 0))
if (port.m_link_training > 0)
{
sai_port_link_training_rx_status_t rx_status;
sai_port_link_training_failure_status_t failure;
Expand Down
1 change: 0 additions & 1 deletion orchagent/portsorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ class PortsOrch : public Orch, public Subject
void deInitPort(string alias, sai_object_id_t port_id);

void initPortCapAutoNeg(Port &port);
void initPortCapLinkTraining(Port &port);

bool setPortAdminStatus(Port &port, bool up);
bool getPortAdminStatus(sai_object_id_t id, bool& up);
Expand Down

0 comments on commit 876e605

Please sign in to comment.