Skip to content

Commit

Permalink
Fix port speed validation (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriymoroz-mlnx authored and lguohan committed Aug 22, 2017
1 parent 8c922a5 commit eaccf67
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,22 @@ bool PortsOrch::validatePortSpeed(sai_object_id_t port_id, sai_uint32_t speed)
}
else
{
SWSS_LOG_ERROR("Failed to get supported speed list for port %lx\n", port_id);
SWSS_LOG_ERROR("Failed to get supported speed list for port %lx", port_id);
return false;
}
}
// TODO: change to macro SAI_STATUS_IS_ATTR_NOT_SUPPORTED once it is fixed in SAI
// https://github.com/opencomputeproject/SAI/pull/710
else if (((status) & (~0xFFFF)) == SAI_STATUS_ATTR_NOT_SUPPORTED_0)
{
// unable to validate speed if attribute is not supported on platform
// assuming input value is correct
SWSS_LOG_WARN("Unable to validate speed for port %lx. Not supported by platform", port_id);
return true;
}
else
{
SWSS_LOG_ERROR("Failed to get number of supported speeds for port %lx\n", port_id);
SWSS_LOG_ERROR("Failed to get number of supported speeds for port %lx", port_id);
return false;
}
}
Expand Down

0 comments on commit eaccf67

Please sign in to comment.