Skip to content

Commit

Permalink
Revert "[portsorch]: Update comments (sonic-net#333)"
Browse files Browse the repository at this point in the history
This reverts commit f208eb7.
  • Loading branch information
Shu0T1an ChenG committed Oct 5, 2017
1 parent 5dd5e36 commit fd699c9
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ bool PortsOrch::validatePortSpeed(sai_object_id_t port_id, sai_uint32_t speed)
attr.id = SAI_PORT_ATTR_SUPPORTED_SPEED;
attr.value.u32list.count = 0;
attr.value.u32list.list = NULL;

status = sai_port_api->get_port_attribute(port_id, 1, &attr);
if (status == SAI_STATUS_BUFFER_OVERFLOW)
{
Expand Down Expand Up @@ -544,7 +543,7 @@ bool PortsOrch::initPort(const string &alias, const set<int> &lane_set)
p.m_index = static_cast<int32_t>(m_portList.size()); // TODO: Assume no deletion of physical port
p.m_port_id = id;

/* Initialize the port and create corresponding host interface */
/* Initialize the port and create router interface and host interface */
if (initializePort(p))
{
/* Add port to port list */
Expand Down Expand Up @@ -679,7 +678,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
}
else
{
it++;
++it;
}
}

Expand Down Expand Up @@ -709,12 +708,6 @@ void PortsOrch::doPortTask(Consumer &consumer)
}
else
{
/* Set port speed
* 1. Get supported speed list and validate if the target speed is within the list
* 2. Get the current port speed and check if it is the same as the target speed
* 3. Set port admin status to DOWN before changing the speed
* 4. Set port speed
*/
if (speed != 0)
{
sai_uint32_t current_speed;
Expand All @@ -730,7 +723,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
{
if (speed != current_speed)
{
if (setPortAdminStatus(p.m_port_id, false))
if(setPortAdminStatus(p.m_port_id, false))
{
if (setPortSpeed(p.m_port_id, speed))
{
Expand All @@ -753,14 +746,13 @@ void PortsOrch::doPortTask(Consumer &consumer)
{
SWSS_LOG_ERROR("Failed to get current speed for port %s", alias.c_str());
}

}

if (admin_status != "")
{
if (setPortAdminStatus(p.m_port_id, admin_status == "up"))
{
SWSS_LOG_NOTICE("Set port %s admin status to %s", alias.c_str(), admin_status.c_str());
}
else
{
SWSS_LOG_ERROR("Failed to set port %s admin status to %s", alias.c_str(), admin_status.c_str());
Expand All @@ -772,9 +764,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
if (mtu != 0)
{
if (setPortMtu(p.m_port_id, mtu))
{
SWSS_LOG_NOTICE("Set port %s MTU to %u", alias.c_str(), mtu);
}
else
{
SWSS_LOG_ERROR("Failed to set port %s MTU to %u", alias.c_str(), mtu);
Expand Down

0 comments on commit fd699c9

Please sign in to comment.