Skip to content

Commit

Permalink
sonic-sairedis updates for MPLS
Browse files Browse the repository at this point in the history
  • Loading branch information
qbdwlr committed Jun 7, 2021
1 parent 0e2105a commit 35368c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions meta/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1786,8 +1786,11 @@ sai_status_t Meta::objectTypeGetAvailability(
PARAMETER_CHECK_OID_OBJECT_TYPE(switchId, SAI_OBJECT_TYPE_SWITCH);
PARAMETER_CHECK_OID_EXISTS(switchId, SAI_OBJECT_TYPE_SWITCH);
PARAMETER_CHECK_OBJECT_TYPE_VALID(objectType);
PARAMETER_CHECK_POSITIVE(attrCount);
PARAMETER_CHECK_IF_NOT_NULL(attrList);
// When checking availability of a resource solely based on OBJECT_TYPE, attrCount is 0
if (attrCount)
{
PARAMETER_CHECK_IF_NOT_NULL(attrList);
}
PARAMETER_CHECK_IF_NOT_NULL(count);

auto info = sai_metadata_get_object_type_info(objectType);
Expand Down
15 changes: 15 additions & 0 deletions vslib/src/VirtualSwitchSaiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,21 @@ sai_status_t VirtualSwitchSaiInterface::objectTypeGetAvailability(
*count = 3;
return SAI_STATUS_SUCCESS;
}
else if (objectType == SAI_OBJECT_TYPE_INSEG_ENTRY)
{
*count = 1000;
return SAI_STATUS_SUCCESS;
}
else if (objectType == SAI_OBJECT_TYPE_NEXT_HOP)
{
// MPLS NH CRM uses sai_object_type_get_availability() API.
if (attrList && (attrList[0].id == SAI_NEXT_HOP_ATTR_TYPE) &&
(attrList[0].value.s32 == SAI_NEXT_HOP_TYPE_MPLS))
{
*count = 1000;
return SAI_STATUS_SUCCESS;
}
}

return SAI_STATUS_NOT_SUPPORTED;
}
Expand Down

0 comments on commit 35368c6

Please sign in to comment.