-
Notifications
You must be signed in to change notification settings - Fork 94
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
[sai-gen] Add P4 counter parsing support in SAI generation script and remove mock counter attributes in DASH pipeline #492
Conversation
Hi @chrispsommers , this is the change I mentioned in #489 which improves SAI API generation for counters. |
483de6b
to
77c8557
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix CI failures.
Thanks a lot Chris! And Merry Christmas! |
CI is passed. Happy new year, @vijasrin ! Do you have any comments on this PR? If not, I will merge the change in. :D |
thanks Kamil for reviewing it as well! since no more comments, I have the PR merged now. |
Problem
Today, how DASH generates SAI API for counters is via mock action parameters.
One example is shown as below, where the counters are not updated by the meter_bucket_action, however we need to generate SAI APIs for fetching these counters. Hence, 2 action parameters that is marked as readonly are added for this purpose.
However, this creates 2 problems:
Solution
This change adds counter parsing support in the SAI generation script, which,
Then we use this info to generate the correct SAI headers and libsai. Here is the P4 code after this change, the unused action parameters can be removed:
As the diff shows below, we will be able maintain the SAI header unchanged, also removing the unwanted code in libsai:
Future works
As we will be adding more counters later, for features like HA. This will become particularly helpful, since we don't have to abuse the action parameters with unused code anymore.