-
Notifications
You must be signed in to change notification settings - Fork 88
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
Does P4Runtime support struct action parameters? #405
Comments
For another point of reference, please see section 21 "Known Limitations of Current P4Runtime Version" https://p4.org/p4-spec/docs/p4runtime-spec-working-draft-html-version.html#sec-known-limitations-of-current-p4runtime-version
If that part of the spec is obsolete, it should be removed. |
I see. I didn't notice that part of the spec previously! Then my understanding is that syntactically, any |
That is also my understanding, yes. Also, even if the Protobuf definitions might not require any changes to become more general in types of action parameters that are supported, P4Runtime client and server implementations certainly would need updating to support more types, as I suspect that most or all of them have been developed with that type restriction in mind. |
@qobilidop Note that the work on GenericTable in the API work group the last couple of months is intended to enable generalizing key and action parameter types to structs, and many other more general things. That work is still in progress, not yet implemented in open source as of 2023-Aug, etc. but you may want to keep track of it at least occasionally. |
This is a follow-up on p4lang/p4c#3760 (comment) (@jfingerh). I have taken a closer look at the P4Runtime protos, and would like to continue the P4Runtime side of discussion here. I have a feeling struct action parameters are already expressible in P4Runtime, but needs confirmation or correction from P4Runtime experts.
On the P4Info side, there is a
type_name
for eachParam
:p4runtime/proto/p4/config/v1/p4info.proto
Lines 243 to 260 in e70ee7b
The actual type spec could be looked up in
P4TypeInfo
:p4runtime/proto/p4/config/v1/p4types.proto
Lines 55 to 63 in e70ee7b
p4runtime/proto/p4/config/v1/p4types.proto
Lines 83 to 85 in e70ee7b
So in principle, the P4Info file could express a struct action parameter, right?
On the P4Runtime service side, action parameters are specified as flat bytes:
p4runtime/proto/p4/v1/p4runtime.proto
Lines 266 to 273 in e70ee7b
A user-defined struct could easily be flattened as bytes. So I think there is no issue either?
The text was updated successfully, but these errors were encountered: