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 found the commit to behavioral-model where the capability to accept "hexstr" elements was added, but it wasn't clear to me from reading that why it was added.
Does P4_14 allow constants in a field_list definition?
It makes sense that P4_16 allows constants in a list of fields given as an arg to a call like a hash or checksum calculation. Was that the motivation?
Separate from that question, does it seem to you like it would always be a mistake of some kind if a field list used for recirculate, resubmit, or clone3 primitives of simple_switch contained an element with type "hexstr"? I cannot think of any reason why that would make sense. The current p4c can sometimes generate such a field_list, but I am guessing that it is always a sign of a bug in p4c when it does so.
The text was updated successfully, but these errors were encountered:
Answering one of my own questions, which I should have looked up before asking: The P4_14 spec does allow constant values in field_list definitions. Probably primarily for the purpose of hash/checksum calculation input lists, would be my guess.
The other question about whether constant values make sense in a recirculate/resubmit/clone3 primitive is still open, in my mind.
I am pretty sure that the answer to the question: "Does it make sense for a recirculate/resubmit/clone primitive to contain constant values?" is "No, that is a sign of a bug in p4c bmv2 back end."
I have a Python program that can detect this and a few other similar problems in such field lists, written to see how prevalent this issue is in p4c: p4lang/p4c#1669
simple_switch can read without error arbitrary mixes of type "hexstr" and "field" inside of the "elements" list, as shown in the example below:
I found the commit to behavioral-model where the capability to accept "hexstr" elements was added, but it wasn't clear to me from reading that why it was added.
Does P4_14 allow constants in a
field_list
definition?It makes sense that P4_16 allows constants in a list of fields given as an arg to a call like a hash or checksum calculation. Was that the motivation?
Separate from that question, does it seem to you like it would always be a mistake of some kind if a field list used for recirculate, resubmit, or clone3 primitives of simple_switch contained an element with type "hexstr"? I cannot think of any reason why that would make sense. The current
p4c
can sometimes generate such a field_list, but I am guessing that it is always a sign of a bug inp4c
when it does so.The text was updated successfully, but these errors were encountered: