sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
83 stars 89 forks source link

[sai-gen] Add support of generating hit count counters #531

Closed r12f closed 7 months ago

r12f commented 7 months ago

Problem

In today's DASH SAI generator, we support 3 type of counters: SAI counter ID, SAI Attributes and SAI stats. Due to the nature of P4 counters, the counters are used as packet counters or byte counters, hence all counters will either have _PACKET or _BYTES suffix.

However, we have many counters that doesn't work as packet counters, for example - how many flows is created or deleted.

What we are doing in this change

This change updates the SAI generator to support the counters without suffix. This allows us to support generating hit-count type counters.

For example, if we have these counters defined in P4: image

The following stats will be generated on the ENI: image