-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Links:
- P4 language spec issue, with further links tracking parts of the work: Design syntax and semantics to indicate persistent storage of per-table-entry data across packets, modifiable in data plane p4-spec#1177
- Current status as of 2024-Sep-14: waiting for someone (probably from AMD) to create an implementation of it in open source p4c, before any language spec changes are made: Data plane writable per table entry state v1 p4-spec#1239
TNA defines the DirectRegister extern to do this: https://github.com/barefootnetworks/Open-Tofino/blob/master/share/p4c/p4include/tofino1_base.p4#L621-L636 along with a few other related externs such as DirectRegisterAction.
Mario Baldi has proposed what I would consider a more natural-to-write technique whereby P4 actions have a new "direction" on some of its parameters, such that it enables P4 writers to assign values to those action parameters within the body of the action, and the new values assigned will be "written back" to the data associated with that table entry when the action is finished executing, which logically must complete before the next packet that matches the same entry begins executing that action, which should always see the data as updated by the previous packet matching that entry.
TODO: It would be good to link here to some practical public examples that use these.
TODO: Link to Mario's public presentation to PNA work group here.
TOOD: Is it straightforward to write a P4 compiler that transforms Mario's style of P4 code into code that works with TNA's externs? If yes, then that would be nice for the Tofino P4 compiler to implement.