You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that right now, the BMv2 JSON file has no representation of the defaultonly and tableonly attributes in P4 source code. These can be used to annotate the list of actions for a table. See the P4_16 language spec, but basically defaultonly means that the action cannot be used as an action for a normal table entry, only as the default action. Similarly tableonly means that the action cannot be used as the default action, only as an action for an installed table entry.
This knowledge could be used by p4pktgen to avoid considering execution paths with disallowed actions. Right now I believe it has no such information available to it, and so considers all actions of a table for both normal table entries, and as a possible default action.
The text was updated successfully, but these errors were encountered:
jafingerhut
changed the title
Enhancement: use P4Runtime info file for a P4 program to get tableonly and defaultonly attributes
Use P4Runtime info file for a P4 program to get tableonly and defaultonly attributes
Oct 26, 2018
Attaching a small test program for which latest current version of p4pktgen on hybrid_packet branch generates 6 SUCCESS paths. 4 of them are correct. 2 of them should never have been considered by p4pktgen, if it had the information about the @tableonly and @defaultonly attributes of the actions on the table, and took them into account.
Probably the most straightforward way for p4pktgen to learn about these attributes is to read not only the BMv2 JSON file, but also the P4Runtime info file, perhaps the JSON one generated via a command like p4c --target bmv2 --arch v1model --p4runtime-file impossible1.p4rt.json --p4runtime-format json impossible1.p4
I believe that right now, the BMv2 JSON file has no representation of the defaultonly and tableonly attributes in P4 source code. These can be used to annotate the list of actions for a table. See the P4_16 language spec, but basically defaultonly means that the action cannot be used as an action for a normal table entry, only as the default action. Similarly tableonly means that the action cannot be used as the default action, only as an action for an installed table entry.
Related issue: p4lang/behavioral-model#676
This knowledge could be used by p4pktgen to avoid considering execution paths with disallowed actions. Right now I believe it has no such information available to it, and so considers all actions of a table for both normal table entries, and as a possible default action.
The text was updated successfully, but these errors were encountered: