-
Notifications
You must be signed in to change notification settings - Fork 82
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
PSA Annotations to specify packet ordering constraints #568
Comments
Comment by @jamescoole-cisco copied and pasted here: Since a subset of applications will care about ordering, I think it would be good to recommend or require that implementors provide a way for users to request that the compiler preserve ordering per-application. A simple way to expose this would be a compiler switch, but a https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/EXTENSION.html This seems like an improvement over "asking the vendor" for a couple of reasons. First, without being able to specify this as a requirement in the source, portability becomes a function of whether the application compiles on a given target and whatever response the user got if/when they asked the switch vendor about ordering guarantees. Also, for some targets whether these recommendations are met might not come directly from the device architecture, and might instead be possible with some tradeoffs. For example, a high-level synthesis tool may be able to increase parallelism when ordering isn't required by the program, but could support ordering when required by linearizing the pipeline, at the cost of latency and/or area. |
James, definitely reasonable suggestions there. The only part I am hesitating on is a good way to define and name such annotations/pragmas in the source code. I could imagine starting with a separate PSA-standard name for each of the 4 recommendations described in the text here, but suspect that there might be variations on them that will end up being useful. Maybe we just stick a stake in the sand and give PSA-standard names to these 4 recommendations for now, and handle future ones as they become clearer? |
In another issue, @mbudiu-vmw proposed that for 'global' pragma type things, one way might be to have a global const definition, e.g. for a program version number with a standard-defined const name, and then P4_16 annotations can be put on that const definition. Those would be considered global annotations applying to the whole program. |
Yep, I think it makes sense to just define names for the four current recommendations so that each can be required by a program. If there are other guarantees that architectures want to offer, those could be vendor extensions handled similarly to PSA's defined names. If they become popular, they could be rolled into future PSAs with standardized names. Using annotations may be better than adding pragmas, but would they need to be pinned to a top-level variable declaration? It might be confusing to mix variable and pragma naming. How about something like this? @ordering("psa_RECOMMENDATION_1") // standard
@ordering("acme_<>") // vendor
PSA_Switch(/*...*/) main; |
Of course, |
I don't think type arguments are needed for this annotation, but it might be a useful language extension for other use cases. |
This issue was raised by @jamescoole-cisco on this PR: #552
Creating a separate issue for it, to allow that PR to be merged in before we have answers for this issue.
The text was updated successfully, but these errors were encountered: