sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
78 stars 88 forks source link

[sai-gen] Add counter id generation support on port level #508

Closed r12f closed 5 months ago

r12f commented 5 months ago

Problem

Currently, whenever a counter is used in a control block and not associated to any tables, we won't be able to handle the SAI header generation for it, although we know this counter will be mostly used for tracking the DPU level counts.

What we are doing in this change

This change adds counter id generation support on port level. Whenever the above case happens, a new counter id attribute will be generated on port level.

Take an example - if we add a counter to track total bytes in DASH as below: image image

The following counter id attribute will be generated: image

r12f commented 5 months ago

thanks Kamil and Chris!

LGTM, do you intend to utilize this in some p4 code soon?

yea, this is made to support the port level counter id in the fast path design doc as well as counters in HA. and to avoid the final PR being too large, I split the change into these prerequisite PRs.

I have another one with stats generation, and after that i will send the fast path SAI API one out. Hopefully this can help connects the dots with the recent PRs without any model updates.