Skip to content

Commit

Permalink
Update discussion of entry priorities in constant tables (#457)
Browse files Browse the repository at this point in the history
* Update discussion of entry priorities in constant tables

* Correct description of entry priority for constant tables
  • Loading branch information
jafingerhut authored Sep 8, 2023
1 parent a380607 commit f0e9f33
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/v1/P4Runtime-Spec.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -3330,19 +3330,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 a
constant table with `N` entries starting at `N` for the first entry
and decrementing the 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

0 comments on commit f0e9f33

Please sign in to comment.