Open jafingerhut opened 1 year ago
Also create a PTF test that verifies:
For a table with const entries
:
const
flag equal to true on all entries.For a table with const default_action
const
flag equal to true on the default actionFor a table with entries
without const
before entries
:
const
qualifier on the individual entry that we are attempting to modify or delete.const
qualifier on the entry in the source code.PR https://github.com/p4lang/p4c/pull/4080 has been merged now, which is significant progress on completing this issue.
What remains to be done:
I approved of PR https://github.com/p4lang/p4c/pull/3748 because I think it is a good significant start at a full implementation of tables with
entries
withoutconst
beforeentries
, and I preferred having something that is nearly complete merged in sooner, and make minor additions or fixes to it later, because I do not know how long it will take for the P4 API work group to finalize their decisions on those details.See https://github.com/p4lang/p4runtime/issues/426 for the issue on the P4Runtime API specification. When that issue is resolved, this one should be revisited.
The minor issues that I know of that remain are:
it seems likely that we will want some per-table property in the P4Info file for tables that have
entries
but notconst entries
, and this seems likely to be some new field, notis_const_table
. When a name and semantics for that new field have been decided, it should be written to the P4Info file for such tables by p4c.How should entries marked
const
inside ofentries
be distinguished from those NOT markedconst
, inside of the "entries" output file?How should priorities be written to the entries output file for tables with
largest_priority_wins = false
? Since the entries file is always consumed by P4Runtime API, I would recommend that the priority values calculated for entries from the source code by p4c should become(M-P)
in the P4Runtime entries file, whereP
is the priority of the entry calculated by p4c, andM
is some maximum supported priority value by P4Runtime API, perhaps 2^32 or (2^32-1).