-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P4 2016 draft: named field lists #51
Comments
@mbudiu-vmw Is this a must or good-to-have? |
It's good to have. By adding tuples we have made a step forward. If we want field lists to be left-values we may need special support, otherwise this could be implemented by just having a function that returns a tuple. So we just have to add functions to the language... |
Another place where fields lists turn out to be really useful/necessary is for the 'clone' primitive. When cloning/mirroring a packet in P4_14, you specify (as a field list) a list of metadata fields to be preserved in the cloned packet. The data in these metadata fields (and only these fields) is copied from the cloning thread to the new thread for the cloned packet, rather than being initialized to zero. So here the field_list is supplying a list (or tuple) of locations rather than a list of values as is the case for most other uses of field lists (hash and digest primitives, checksums) |
Field lists can be modeled to some degree with an action that takes a struct as in argument and a tuple as an out argument - the tuple is the field list. E.g.
|
I believe that the PSA draft we have now has an alternate method for specifying metadata that gets carried with packets, both for cloned packets and all others that can carry metadata "next to" each packet. I know that Vladimir has mentioned field lists, which have properties that they are like references to locations, rather than the current values of the fields at the point of the field list definition, might be useful in defining language features such as the one proposed in the issue linked below, but it isn't clear to me yet why field lists help there. |
Discussed at 11/5/2018 LDWG. Still in hibernation. |
@mbudiu-vmw should this issue be closed if we take the |
The p4-16 language does not have anything equivalent to named field lists.
The text was updated successfully, but these errors were encountered: