Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
*Added more appropriate log message for CRM queries of MPLS_INSEG and MPLS_NEXTHOP resources when platform does not support these resource types.
  • Loading branch information
qbdwlr authored and raphaelt-nvidia committed Oct 5, 2021
1 parent 6d8f532 commit 9bdc253
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@ void CrmOrch::getResAvailableCounters()
sai_status_t status = sai_object_type_get_availability(gSwitchId, objType, 0, nullptr, &availCount);
if (status != SAI_STATUS_SUCCESS)
{
if ((status == SAI_STATUS_NOT_SUPPORTED) ||
(status == SAI_STATUS_NOT_IMPLEMENTED) ||
SAI_STATUS_IS_ATTR_NOT_SUPPORTED(status) ||
SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(status))
{
// mark unsupported resources
res.second.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
SWSS_LOG_NOTICE("CRM Resource %s not supported", crmResTypeNameMap.at(res.first).c_str());
break;
}
SWSS_LOG_ERROR("Failed to get availability for object_type %u , rv:%d", objType, status);
break;
}
Expand All @@ -585,6 +595,16 @@ void CrmOrch::getResAvailableCounters()
sai_status_t status = sai_object_type_get_availability(gSwitchId, objType, 1, &attr, &availCount);
if (status != SAI_STATUS_SUCCESS)
{
if ((status == SAI_STATUS_NOT_SUPPORTED) ||
(status == SAI_STATUS_NOT_IMPLEMENTED) ||
SAI_STATUS_IS_ATTR_NOT_SUPPORTED(status) ||
SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(status))
{
// mark unsupported resources
res.second.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
SWSS_LOG_NOTICE("CRM Resource %s not supported", crmResTypeNameMap.at(res.first).c_str());
break;
}
SWSS_LOG_ERROR("Failed to get availability for object_type %u , rv:%d", objType, status);
break;
}
Expand Down

0 comments on commit 9bdc253

Please sign in to comment.