-
Notifications
You must be signed in to change notification settings - Fork 444
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
Include header in text proto files #4070
Comments
Thanks for the issue, Steffen. I will point out that there are many consumers of the current P4Info text file format today (whether that was a good design decision to do so, I leave to a separate discussion). Thus changes to it will likely lead to updates required in those many consumers. |
Do we expect that some of these customer parse the P4Info files manually, instead of using the protobuf library? EDIT: In particular, anything after a |
Perhaps. You can check what the behavioral-model simple_switch_grpc, does, for at least one public example. |
This BMv2 test helper function does use the official parser: https://github.com/p4lang/behavioral-model/blob/6ee70b5eff7f510b32c074aaa4f00358f594fecb/targets/simple_switch_grpc/tests/utils.cpp#L95-L103.
If the P4Info file is configured via grpc, using the |
@fruffy Does P4TestGen do any protobuf text file parsing? Does it support comments? |
No, we do not do any parsing, we just generate |
If you wanted to make a test change to a textproto format P4Info file to add the wrapper you are suggesting, and then load that into the existing simple_switch_grpc, and everything works, then that is one less consumer to be worried about. In case you cannot tell, I am a big fan of actually trying it out to see if it works, rather than theorizing what we think ought to work :-) |
Makes sense :)
Just trying to understand how to load the P4Info. I’m used to doing it via
P4Runtime, but I suspect there might also be a CLI flag? And perhaps also
for table entries?
…On Wed, Jul 19, 2023 at 12:31 Andy Fingerhut ***@***.***> wrote:
If the P4Info file is configured via grpc, using the
SetForwardingPipelineConfig service, then no manual parsing would be needed
at all since grpc scaffolding will take care of it already. So not sure
where to look?
If you wanted to make a test change to a textproto format P4Info file to
add the wrapper you are suggesting, and then load that into the existing
simple_switch_grpc, and everything works, then that is one less consumer to
be worried about.
In case you cannot tell, I am a big fan of actually trying it out to see
if it works, rather than theorizing what we think ought to work :-)
—
Reply to this email directly, view it on GitHub
<#4070 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSVS4VH36FOM4AA3IB3DJ3XRAYZ5ANCNFSM6AAAAAA2OYCEFQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
At least for PTF tests, which use I am not sure about other targets. It is unclear who is using P4Info at this point. |
Antonin Bas said in our last P4 API work group meeting that simple_switch_grpc does not use the entries file, so my suggestion of loading a hand-edited entries file into simple_switch_grpc to see if it is incompatible is not useful. Sorry about that. He said that |
p4c generates protobuf files in text format. E.g,. when we call
then
p4info.txt
andentries.txt
are both protobuf files in text format.It is good practice to include a header in text proto files.
Proposal
P4Info
Entries File
Context
This came up in p4lang/p4runtime#432 (comment), where it wasn't clear what the schema of the table entries file was. A header would have helped to quickly resolve this. @jafingerhut for visibility.
The text was updated successfully, but these errors were encountered: