-
Notifications
You must be signed in to change notification settings - Fork 92
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] Deprecate the name annotations in favor of SaiTable #479
Conversation
Ok, the PR is ready for review. @chrispsommers , with this all tables are off the |
dash-pipeline/bmv2/underlay.p4
Outdated
@name("route|route") | ||
// TODO: To add structural annotations (example: @SaiTable[skipHeaderGen=true]) | ||
@SaiTable[name = "route", api = "route"] | ||
// TODO: To add structural annotations (example: @SaiTable[skipHeaderGen=true]] |
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.
I think this comment can be deleted. The idea of a new attribute skipHeaderGen
was not followed, instead the api name omits the dash
which is kind of a heuristic in the api_gen code, see here:
DASH/dash-pipeline/SAI/sai_api_gen.py
Line 910 in e6a8e98
if "dash" in sai_api.app_name: |
dash
in the table name but IMO it's still a hidden assumption.
Do you think it'd be more consistent to use the attribute skipHeaderGen
or some other aptly-named one to explicitly direct the codegen not to emit header code for a table? It would default to false.
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.
of course! will update the PR soon. (will be afk for a hour or so.)
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.
thanks a lot for capturing this! i totally missed this one.
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.
It's obscure, and in full disclosure, I oversaw the addition of underlay API so it is incumbent on me - thanks for offering to address it!
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.
Since essentially, the dash prefix affects the generation of both the header files and implementation files, instead of using "skiopHeaderGen", I added a new attribute called "api_type" and set to "underlay" to more precisely reflect what we are doing.
The changes are commited now. Please let me know what you think! :D
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.
and of course, no SAI header file change and only table id updates in lib files.
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.
ok, test passed now. @chrispsommers , it should be good to take another look now.
[like] Kristina Moore reacted to your message:
…________________________________
From: Riff ***@***.***>
Sent: Tuesday, December 12, 2023 9:02:52 PM
To: sonic-net/DASH ***@***.***>
Cc: Kristina Moore ***@***.***>; Mention ***@***.***>
Subject: Re: [sonic-net/DASH] [sai-gen] Deprecate the name annotations in favor of SaiTable (PR #479)
Ok, the PR is ready for review.
@chrispsommers<https://github.com/chrispsommers> , with this all tables are off the @name annotation.
@jafingerhut<https://github.com/jafingerhut> and @fruffy<https://github.com/fruffy>, this change should help solving the issue #347<#347> . ***@***.***<https://github.com/KrisNey-MSFT> as FYI as well)
—
Reply to this email directly, view it on GitHub<#479 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFJSI6EIS2YHY3N4SVHRC4DYJDA7ZAVCNFSM6AAAAABASC2II6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSHAYDMOBYGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This PR has 2 updates:
@name
annotations in favor of@SaiTable
.api_order
attribute in@SaiTable
annotation to help us enforce the order of the generated APIs.The second change is a must have, otherwise for any API set that contains multiple type of entries (generated from multiple tables), the order could be changed between changes and break the ABI compatibility as the screenshot shows below:
The doc is also updated to capture the use of this new attribute.
For generated content updates:
No updates on SAI header files:
For libsai, table id will be updated as previous change.