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

Update discussion of entry priorities in constant tables #457

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions docs/v1/P4Runtime-Spec.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -3309,19 +3309,17 @@ The contents of const tables can be queried by the client through a
the following fields must be set by the server: `table_id`, `match`, `action`,
`is_default_action`, and `priority` (if required). This is in addition to any
direct resources that are being queried. Idle timeouts are not supported for
static entries. If the table requires a priority value for entries, the server
must populate the `priority` field appropriately, starting at 1 for the lowest
priority entry and incrementing the value by 1 for each successive entry. Note
that P4~16~ does not support assigning explicit priorities to entries
declared with `const entries`[^ConstEntriesPriorities]. When a
priority value is required (⪚ for tables including `RANGE`,
`TERNARY` or `OPTIONAL` matches), it is inferred based on the order in
which entries appear in the table declaration.
static entries.

[^ConstEntriesPriorities]: This is not yet explicit in the P4~16~
language specification, but will become so if this or a similar
clarification is added to it:
<https://github.com/p4lang/p4-spec/pull/1259>
When a priority value is required (&eg; for tables including `RANGE`,
`TERNARY` or `OPTIONAL` matches), it is inferred based on the order in
which entries appear in the table declaration. As of August 2023, the
open source `p4c` compiler always assigns entry priority values in
constant tables starting at 1 for the first entry and incrementing the
jonathan-dilorenzo marked this conversation as resolved.
Show resolved Hide resolved
value by 1 for each successive entry. The P4~16~ language
specification does not preclude the P4 developer from explicitly
specifying priorities for entries in constant tables, but `p4c` does
not yet support this.

### Preinitialized tables { #sec-preinitialized-tables }

Expand Down
Loading