Skip to content

Commit dccd9f7

Browse files
committed
[crm] Fix for Issue sonic-net/sonic-buildimage#8036
1 parent c805021 commit dccd9f7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

orchagent/crmorch.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,16 @@ void CrmOrch::getResAvailableCounters()
565565
sai_status_t status = sai_object_type_get_availability(gSwitchId, objType, 0, nullptr, &availCount);
566566
if (status != SAI_STATUS_SUCCESS)
567567
{
568+
if ((status == SAI_STATUS_NOT_SUPPORTED) ||
569+
(status == SAI_STATUS_NOT_IMPLEMENTED) ||
570+
SAI_STATUS_IS_ATTR_NOT_SUPPORTED(status) ||
571+
SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(status))
572+
{
573+
// mark unsupported resources
574+
res.second.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
575+
SWSS_LOG_NOTICE("CRM Resource %s not supported", crmResTypeNameMap.at(res.first).c_str());
576+
break;
577+
}
568578
SWSS_LOG_ERROR("Failed to get availability for object_type %u , rv:%d", objType, status);
569579
break;
570580
}
@@ -585,6 +595,16 @@ void CrmOrch::getResAvailableCounters()
585595
sai_status_t status = sai_object_type_get_availability(gSwitchId, objType, 1, &attr, &availCount);
586596
if (status != SAI_STATUS_SUCCESS)
587597
{
598+
if ((status == SAI_STATUS_NOT_SUPPORTED) ||
599+
(status == SAI_STATUS_NOT_IMPLEMENTED) ||
600+
SAI_STATUS_IS_ATTR_NOT_SUPPORTED(status) ||
601+
SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(status))
602+
{
603+
// mark unsupported resources
604+
res.second.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
605+
SWSS_LOG_NOTICE("CRM Resource %s not supported", crmResTypeNameMap.at(res.first).c_str());
606+
break;
607+
}
588608
SWSS_LOG_ERROR("Failed to get availability for object_type %u , rv:%d", objType, status);
589609
break;
590610
}

0 commit comments

Comments
 (0)