Skip to content
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

[P4RT] Failed to validate P4Info. PacketIO metadata not supported by P4Info. #130

Open
pantmal opened this issue Jul 17, 2024 · 1 comment

Comments

@pantmal
Copy link

pantmal commented Jul 17, 2024

Hello everyone. I'm trying to use p4runtime-shell in order to connect and push p4 config files to a Virtual Switch that's running SONiC. The image was built using the following repo: https://github.com/sonic-net/sonic-buildimage

Now, while I'm able to connect to the switch using p4runtime-shell with: python3 -m p4runtime_sh --grpc-addr <Switch-Address>:9559 when I try to push the config files (python3 -m p4runtime_sh --grpc-addr <Switch-Address>:9559 --config <path-to-info-file>/p4info.txt,<path-to-bmv2-file>/bmv2.json), I receive the following error:

CRITICAL:root:Error when setting config
CRITICAL:root:P4Runtime RPC error (INVALID_ARGUMENT): [P4RT] Failed to validate P4Info. Details: PacketIO metadata not supported by P4Info. deleted: controller_packet_metadata[0]: { preamble { id: 81826293 name: "packet_in" alias: "packet_in" annotations: "@controller_header(\"packet_in\")" } metadata { id: 1 name: "ingress_port" type_name { name: "port_id_t" } } metadata { id: 2 name: "target_egress_port" type_name { name: "port_id_t" } } }
deleted: controller_packet_metadata[1]: { preamble { id: 76689799 name: "packet_out" alias: "packet_out" annotations: "@controller_header(\"packet_out\")" } metadata { id: 1 name: "egress_port" type_name { name: "port_id_t" } } metadata { id: 2 name: "submit_to_ingress" bitwidth: 1 } metadata { id: 3 name: "unused_pad" bitwidth: 7 } }|

Is anyone familiar with this error and why it occurs? I have also pushed the same p4 config files to a Virtual Switch that's running P4RT using Stratum and the connection as well as the push of the files is successful. I do believe that either the P4RT app that runs on SONiC may be out of date, or that the specific files are unable to be pushed. Yet again, I did try some other files, but I got the same error message.

I would like someone to point me in the right direction. I'm kind of new to P4 and related tasks, so if the error is unrelated to the p4runtime-shell and I should post the issue to a more appropriate repo, please let me know.

I'm attaching the related files, if that may help.

p4info.txt:
p4info.txt

bmv2.json:
bmv2.json

main.p4: main.p4.txt

@jafingerhut
Copy link
Collaborator

I am not familiar with this particular error and combination of software, no.

Looking at the error message a bit, controller_packet_metadata is a sub-message that can legally appear in a P4Info message, e.g. see this line of the .proto file defining P4Info messages: https://github.com/p4lang/p4runtime/blob/main/proto/p4/config/v1/p4info.proto#L35

Note: That is a link to the latest P4Runtime API specification version of the .proto file defining message formats. Particular implementations might be using an older version of that file, or in some case might even customize it more than that.

What confuses me about that error is that if you are truly using the p4info.txt file that you attach, it does not mention controller_packet_metadata anywhere in it, so it is weird that the network device is complaining that it cannot handle such a message. Either that, or some software between you providing the p4info.txt file you attached, and the place the error occurs, is modifying your P4Info data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants