-
Notifications
You must be signed in to change notification settings - Fork 91
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
Improve P4Runtime Value Set support #156
Improve P4Runtime Value Set support #156
Conversation
The objectives of this change is to: * cover more cases supported by the P4_16 spec * provide more intuitive runtime programming * be more future-proof to reduce the potential changes in future P4Runtime versions In particular, we now support structs with bit<W> members as the type parameter for value_set. The members of the struct may have different match types. Fixes p4lang#135 Fixes p4lang#134
@jafingerhut please take a look, if it passes your review I'll add more people :) |
match { | ||
id: 1 | ||
bitwidth: 8 | ||
match_type: EXACT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the match_type
message be nested inside of a match
message, that is itself inside of the match
message of line 1472?
match { | ||
id: 1 | ||
bitwidth: <ETH_TYPE_BITWIDTH> | ||
match_type: EXACT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above on match_type
being inside of another match
message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other match
message here is a oneof. It doesn't actually create a level of nesting, which is why the field numbering doesn't get a new scope. It is not exactly like a C union. What it means is that when serializing the message, at most one of the fields will be present.
@jafingerhut Thanks for the comments. Do you see any logical issue with the new approach? |
@antoninbas I see no logical problems with any of this. Only the small issues I've already raised. Everything else looks good, and I will approve it. Definitely good to review with others, too, of course. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks. I'll move this to a new PR (I mistakenly created this one from my fork) and invite others to comment. |
Replaced by #157 |
The objectives of this change is to:
P4Runtime versions
In particular, we now support structs with bit members as the type
parameter for value_set. The members of the struct may have different
match types.
Fixes #135
Fixes #134