-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use P4 annotations instead of heuristic in the code generator #276
Comments
@marian-pritsak Does this issue need to stay in the queue? |
We need to keep this item open. It was agreed this is the long term solution. Note, this is a great project for another volunteer, it mainly requires appropriate annotations to P4, and Python changes to https://github.com/Azure/DASH/blob/main/dash-pipeline/SAI/sai_api_gen.py which will become simpler as a result. It could be done incrementally. |
Annotations for tables, keys, action parameters - Marian will prepare a PR for next week. |
hi @chrispsommers - can this one be closed then, considering we have 473? |
No, as @r12f mentioned, the old way to name tables is still in place. This is a step towards the eventual solution. |
Yea, sorry. I probably gave my commit a really bad name... I have already started the work moving the annotation to Sai. |
The first PR is #477 . More PRs will come later, since I am taking today oof... :( |
There are a series of MRs which all contributed to this, but I agree this can be closed. Perhaps @r12f can list the MRs for posterity in a closing comment. Thanks! |
Closing |
The current SAI API code generator https://github.com/Azure/DASH/blob/main/dash-pipeline/SAI/sai_api_gen.py reads the P4Info (derived from dash-pipeline.p4) and emits SAI header (.h) files. Some of the transformations are a bit involved and contain hidden assumptions, and the P4 code does not explicitly show the relationships between P4 and SAI headers, for example when is a SAI attribute mandatory. Using annotations would allow the P4 code to explicitly declare, for example, the SAI table name, or identify a mandatory SAI attribute. Using attributes would also greatly simplfy the code generator, since it would only have to do simple transformations without lots of special-case code.
This idea was originally suggested here: #240 (comment)
A sample experimental annotation is provided below. You can compile the P4 code using
make p4
and read the resulting P4Info filedash-pipeline/bmv2/dash_pipeline.bmv2/dash_pipeline_bmv2_p4rt.txt
in your build environment.https://github.com/chrispsommers/DASH/blob/4ce46efa65bf49bd342efdf43f4b08d454cdb408/dash-pipeline/bmv2/dash_pipeline.p4#L39
The text was updated successfully, but these errors were encountered: