Skip to content

Commit

Permalink
[vslib] implement query for SAI_DEBUG_COUNTER_TYPE enum values (sonic…
Browse files Browse the repository at this point in the history
…-net#842)

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored Jun 21, 2021
1 parent e385212 commit 9949c48
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions vslib/src/VirtualSwitchSaiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,21 @@ sai_status_t VirtualSwitchSaiInterface::queryAattributeEnumValuesCapability(

return SAI_STATUS_SUCCESS;
}
else if (object_type == SAI_OBJECT_TYPE_DEBUG_COUNTER && attr_id == SAI_DEBUG_COUNTER_ATTR_TYPE)
{
if (enum_values_capability->count < 4)
{
return SAI_STATUS_BUFFER_OVERFLOW;
}

enum_values_capability->count = 4;
enum_values_capability->list[0] = SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS;
enum_values_capability->list[1] = SAI_DEBUG_COUNTER_TYPE_PORT_OUT_DROP_REASONS;
enum_values_capability->list[2] = SAI_DEBUG_COUNTER_TYPE_SWITCH_IN_DROP_REASONS;
enum_values_capability->list[3] = SAI_DEBUG_COUNTER_TYPE_SWITCH_OUT_DROP_REASONS;

return SAI_STATUS_SUCCESS;
}

return SAI_STATUS_NOT_SUPPORTED;
}
Expand Down

0 comments on commit 9949c48

Please sign in to comment.