sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
717 stars 1.38k forks source link

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

Open pantmal opened 1 month ago

pantmal commented 1 month ago

Description

Hello everyone. After tackling the Device ID problem in my previous issue (many thanks to all who contributed) (https://github.com/sonic-net/sonic-buildimage/issues/19328), I now want to continue my P4 related tests. So I'm using p4runtime-shell to push some p4 config files to the Virtual Switch and I'm receiving the following error: [P4RT] Failed to validate P4Info. PacketIO metadata not supported by P4Info.

This error appears to be quite odd, because I'm testing a similar P4RT setup using Stratum, and I'm able to push the related files at the Virtual Switch that's using Stratum. I suspect maybe that the P4RT version that's used by this repo, may be out of date. Perhaps some different p4 config files could be the correct ones for the SONiC Virtual Switch, but I'm not having any luck finding said files. Could someone point me in the direction? Should I use different P4 config files? Should the p4rt app receive some updates?

Since this issue appears to be P4 related, I'm open to forward this issue to a different repo, though I want to know which one is the appropriate (e.g. p4runtime-shell, p4c, etc.)

Steps to reproduce the issue:

  1. Build and deploy a SONiC VS image with P4 runtime. You may refer to my previous issue for details: https://github.com/sonic-net/sonic-buildimage/issues/19328
  2. Enable the P4RT container with: /usr/bin/p4rt.sh start and set the Device ID using redis-cil:
    127.0.0.1:6379> select 4
    OK
    127.0.0.1:6379[4]> HMSET "NODE_CFG|integrated_circuit0" "node-id" "1"
    OK
  3. Attempt a connection using P4 runtime shell: python3 -m p4runtime_sh --grpc-addr <Switch-Address>:9559. This successfully connects to the P4RT shell (Though I should note: I'm not sure how to verify what is happening on the switch's side. Are there any logs available?)
  4. Now attempt to push p4 config files with: python3 -m p4runtime_sh --grpc-addr <Switch-Address>:9559 --config <path-to-info-file>/p4info.txt,<path-to-bmv2-file>/bmv2.json

Describe the results you received:

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 } }|

Describe the results you expected:

The command in step 4. should open a connection on the p4runtime-shell with no errors. Also, it would be nice to have a confirmation of what's happening on the SONiC side.

Output of show version:

SONiC Software Version: SONiC.202311.0-dirty-20240613.091833
SONiC OS Version: 11
Distribution: Debian 11.9
Kernel: 5.10.0-23-2-amd64
Build commit: 156b067c8
Build date: Thu Jun 13 06:22:49 UTC 2024
Built by: ubuntu@sonic-test

Platform: x86_64-kvm_x86_64-r0
HwSKU: Force10-S6000
ASIC: vs
ASIC Count: 1
Serial Number: N/A
Model Number: N/A
Hardware Revision: N/A
Uptime: 09:51:27 up 1 min,  1 user,  load average: 1.82, 0.59, 0.21
Date: Tue 16 Jul 2024 09:51:27

Docker images:
REPOSITORY                    TAG                              IMAGE ID       SIZE
docker-dhcp-relay             latest                           ea038747b3d7   310MB
docker-macsec                 latest                           406e6cb6b71e   330MB
docker-orchagent              202311.0-dirty-20240613.091833   2a4a9c3320d3   339MB
docker-orchagent              latest                           2a4a9c3320d3   339MB
docker-fpm-frr                202311.0-dirty-20240613.091833   dc3878aaf2e0   359MB
docker-fpm-frr                latest                           dc3878aaf2e0   359MB
docker-nat                    202311.0-dirty-20240613.091833   17c806a77350   330MB
docker-nat                    latest                           17c806a77350   330MB
docker-snmp                   202311.0-dirty-20240613.091833   8641ee86c5a3   340MB
docker-snmp                   latest                           8641ee86c5a3   340MB
docker-platform-monitor       202311.0-dirty-20240613.091833   73c8ec963096   421MB
docker-platform-monitor       latest                           73c8ec963096   421MB
docker-eventd                 202311.0-dirty-20240613.091833   b57586d33078   301MB
docker-eventd                 latest                           b57586d33078   301MB
docker-teamd                  202311.0-dirty-20240613.091833   cc6421a9c2a6   327MB
docker-teamd                  latest                           cc6421a9c2a6   327MB
docker-sflow                  202311.0-dirty-20240613.091833   a1d8d6d7721c   329MB
docker-sflow                  latest                           a1d8d6d7721c   329MB
docker-sonic-p4rt             202311.0-dirty-20240613.091833   2d97624cad12   874MB
docker-sonic-p4rt             latest                           2d97624cad12   874MB
docker-router-advertiser      202311.0-dirty-20240613.091833   61705160d20b   301MB
docker-router-advertiser      latest                           61705160d20b   301MB
docker-lldp                   202311.0-dirty-20240613.091833   f2e8d2d60d0e   343MB
docker-lldp                   latest                           f2e8d2d60d0e   343MB
docker-mux                    202311.0-dirty-20240613.091833   7403e879e168   350MB
docker-mux                    latest                           7403e879e168   350MB
docker-sonic-gnmi             202311.0-dirty-20240613.091833   b1b5d0e2d58f   389MB
docker-sonic-gnmi             latest                           b1b5d0e2d58f   389MB
docker-database               202311.0-dirty-20240613.091833   3d2ca6fb0049   301MB
docker-database               latest                           3d2ca6fb0049   301MB
docker-gbsyncd-vs             202311.0-dirty-20240613.091833   93be9d4eec58   313MB
docker-gbsyncd-vs             latest                           93be9d4eec58   313MB
docker-syncd-vs               202311.0-dirty-20240613.091833   6c3849753dd6   317MB
docker-syncd-vs               latest                           6c3849753dd6   317MB
docker-sonic-mgmt-framework   202311.0-dirty-20240613.091833   94fa5f7bf654   417MB
docker-sonic-mgmt-framework   latest                           94fa5f7bf654   417MB

Output of show techsupport:

I would suggest referring to the previous issue for the outputs of show techsupport and sudo generate_dump. There have been little, if any, changes since the previous issue, but if it's important to provide files from latest runs of these commands let me know.

Additional information you deem important (e.g. issue happens only occasionally):

Finally, I'm attaching the p4 files I'm trying to push:

p4info.txt: p4info.txt

bmv2.json: bmv2.json

Also, for good measure, here's the .p4 file: main.p4.txt

vmittal-msft commented 1 month ago

@baxia-lan Can you please help on this ?