-
Notifications
You must be signed in to change notification settings - Fork 445
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
Compiler does not implicitly calculate priorities and does not allow explicit priorities for const entries
#4792
Comments
For example:
|
With const entries, the control plane cannot insert more entries (or remove entries), so the compiler has complete control. The priorities in that case are solely based on the order of the const entries, and there's no need for priorities. The priorities only matter if the control-plane can add entries (which will have priorities), in which case they're needed to determine the relative priorities of the control-plane and static entries. |
I have reviewed the sub-section named "Entries" within the section 14.2.1 "Table Properties" of the latest version of the language spec as of 2024-Jul-09, and I did not notice anything there that specifically forbids entry priorities to be specified for a I agree with Chris Dodd that it does not seem very useful to allow a P4 developer to specify them -- the textual order of entries specifies the relative priority, if that match kind of the keys requires it, and specifying particular numeric values would just be an extra burden on the P4 develeper. |
@ChrisDodd @jafingerhut Thank you for clarifying. Would it make sense to make the spec more explicit regarding priorities of |
It would not bother me if the spec explicitly forbade explicit priority values from being specified inside of |
@jafingerhut I probably won't do it anytime soon, but if you want to open a new issue in the p4-spec repo and assign to me I wouldn't mind trying to do that eventually. |
I created this issue, but when I attempt to assign it to you, it does not seem to allow me to specify your Github id: p4lang/p4-spec#1292 |
@jafingerhut Thanks. I will just assign this issue to myself instead as a reminder. |
Currently the compiler does not implicitly calculate priorities that are not explicitly provided when the entries are
const
, and reports an error message whenconst entries
have explicit priorities:Why does it do this? Can anyone point me to where in the spec this
const entries
-specific behavior is described?The text was updated successfully, but these errors were encountered: