Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crm][dash] Do not probe DASH resources on devices other than the DPU. #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
#define CRM_EXCEEDED_MSG_MAX 10
#define CRM_ACL_RESOURCE_COUNT 256

using namespace std;
using namespace swss;

extern sai_object_id_t gSwitchId;
extern sai_switch_api_t *sai_switch_api;
extern sai_acl_api_t *sai_acl_api;
extern event_handle_t g_events_handle;

using namespace std;
using namespace swss;

extern string gMySwitchType;

const map<CrmResourceType, string> crmResTypeNameMap =
{
Expand Down Expand Up @@ -808,6 +808,12 @@ bool CrmOrch::getResAvailability(CrmResourceType type, CrmResourceEntry &res)

bool CrmOrch::getDashAclGroupResAvailability(CrmResourceType type, CrmResourceEntry &res)
{
if (gMySwitchType != "dpu")
{
res.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
return false;
}

sai_object_type_t objType = crmResSaiObjAttrMap.at(type);

for (auto &cnt : res.countersMap)
Expand Down Expand Up @@ -872,6 +878,12 @@ void CrmOrch::getResAvailableCounters()
case CrmResourceType::CRM_SRV6_MY_SID_ENTRY:
case CrmResourceType::CRM_MPLS_NEXTHOP:
case CrmResourceType::CRM_SRV6_NEXTHOP:
case CrmResourceType::CRM_TWAMP_ENTRY:
{
getResAvailability(res.first, res.second);
break;
}

case CrmResourceType::CRM_DASH_VNET:
case CrmResourceType::CRM_DASH_ENI:
case CrmResourceType::CRM_DASH_ENI_ETHER_ADDRESS_MAP:
Expand All @@ -885,8 +897,13 @@ void CrmOrch::getResAvailableCounters()
case CrmResourceType::CRM_DASH_IPV6_OUTBOUND_CA_TO_PA:
case CrmResourceType::CRM_DASH_IPV4_ACL_GROUP:
case CrmResourceType::CRM_DASH_IPV6_ACL_GROUP:
case CrmResourceType::CRM_TWAMP_ENTRY:
{
if (gMySwitchType != "dpu")
{
res.second.resStatus = CrmResourceStatus::CRM_RES_NOT_SUPPORTED;
break;
}

getResAvailability(res.first, res.second);
break;
}
Expand Down
Loading