Skip to content
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] Move default value from template to SAI generation script. #495

Merged
merged 1 commit into from
Dec 24, 2023

Conversation

r12f
Copy link
Collaborator

@r12f r12f commented Dec 23, 2023

Currently, the default value of each SAI attribute is specified in saiapi.h.j2 template, using if-else. This can be simplified by directly using the default value from the type info in SAI generation script.

This change also makes adding more SAI types easier in the future, for both existing types or new types (just like new enums today, we only need to register it to type registry, then everything else will be taken care of).

@r12f r12f merged commit 491c222 into sonic-net:main Dec 24, 2023
4 checks passed
@r12f r12f deleted the user/r12f/default branch December 24, 2023 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants