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] Simplify type solving, move enum type solving to use Sai attribute, add default value in Sai attribute #475

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

r12f
Copy link
Collaborator

@r12f r12f commented Dec 10, 2023

With these changes, we will be able to specify the enum types and default value for any table key and action parameter as below:

@Sai[type="sai_dash_encapsulation_t", default_value="SAI_DASH_ENCAPSULATION_VXLAN"]
dash_encapsulation_t dash_encapsulation,

This removes the dependency on the variable name which has to match with the type.

This leads below code change which makes the generated SAI matches what is in opencompute SAI:

r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
$ diff SAI/SAI/experimental/ ~/data/code/sonic/DASH-exp/dash-pipeline/SAI/SAI/experimental/
diff SAI/SAI/experimental/saiexperimentaldashoutboundrouting.h /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/SAI/experimental/saiexperimentaldashoutboundrouting.h
206c206
<      * @default SAI_DASH_ENCAPSULATION_VXLAN
---
>      * @default SAI_DASH_ENCAPSULATION_INVALID

r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
$ diff SAI/lib ~/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib

@r12f
Copy link
Collaborator Author

r12f commented Dec 10, 2023

This change is built on top of #473 . Please don't review the change until #473 is merged.

After #473 is merged, i will rebase this change to show the real difference.

@r12f
Copy link
Collaborator Author

r12f commented Dec 10, 2023

Ok, now the change is ready for review.

@r12f r12f merged commit 256b533 into sonic-net:main Dec 12, 2023
4 checks passed
@r12f r12f deleted the user/r12f/sai-type branch December 12, 2023 16:16
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