Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: ds952811 <[email protected]>
  • Loading branch information
ds952811 committed May 23, 2022
1 parent 84bdde4 commit 081d491
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1946,35 +1946,18 @@ void PortsOrch::initPortCapAutoNeg(Port &port)
{
// To avoid breakage on the existing platforms, AN should be 1 by default
port.m_cap_an = 1;
SWSS_LOG_WARN("Unable to get %s AN capability, assumming it's supported",
SWSS_LOG_WARN("Unable to get %s AN support capability",
port.m_alias.c_str());
}
}

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

// TODO: Use SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE for the query
//
// While SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE is available at SAI master,
// it's not available in SAI v1.10 paired with SONiC.202205.
// And given that LT is part of AN, it should be okay to use
// SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE as a fallback plan.
attr.id = SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_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
{
// Align with AN to have LT flagged as supported
port.m_cap_lt = 1;
SWSS_LOG_WARN("Unable to get %s LT capability, assumming it's supported",
port.m_alias.c_str());
}
// TODO:
// Add SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE query when it is
// available in the saiport.h of SAI.
port.m_cap_lt = 1;
SWSS_LOG_WARN("Unable to get %s LT support capability", port.m_alias.c_str());
}

/*
Expand Down

0 comments on commit 081d491

Please sign in to comment.