as per the title, I am not able to compile my program for the PSA that includes a header with a varbit field.
I am getting the following error.
./include/headers.p4(151): [–Werror=target-error] error: Type varbit<1648> not supported
In file: /home/sa/p4/p4c/lib/crash.cpp:266
Compiler Bug: Exiting with SIGSEGV
What command line did you use when attempting to compile the program? I ask because it might depend upon the target device (e.g. BMv2, DPDK, EBPF, etc.) you are compiling for whether there is support for it that works, or not.
Nothing in the PSA specification says that targets should NOT support varbit, but nothing specifically says that they must, either.
Thank Andy you for your answer. here are some more details:
My target is the NIKSS vSwitch that uses the eBPF processing engine.
the command as per the the documentation of the NIKSS:
make -f ~/p4c/backends/ebpf/runtime/kernel.mk BPFOBJ=simple_switch.o P4FILE=simple_switch.p4 ARGS=“-DPSA_PORT_RECIRCULATE=2” P4ARGS=“–Wdisable=unused” psa
Hi @Faris, thanks for trying out the NIKSS vSwitch! The varbit type is not supported by the eBPF backend yet. We’re getting more questions about it, so we might prioritize working on that, but I cannot share any ETA.
Also, you’re defining a quite large field (206 bytes). Remember that the BPF stack size is limited (512 bytes limit), so it’s likely that the generated eBPF code will fail to load.
Thank you @osinstom , another curiosity about the NIKSS switch. It seems that the user defined metadata is not carried from ingress to egress (a value that has been set in the ingress goes back to zero in the egress). Is this true about the NIKSS switch ? or maybe I am doing something wrong ?
In the PSA definition, nothing is required to be carried from ingress to egress by default.
If you want something to be carried with the packet from ingress to egress, you must define a struct type containing all of the fields you want to preserve, make it the type of the normal_meta out parameter of the ingress deparser, and the type o0f the normal_meta in parameter of the egress parser, as shown in this example program (search for occurrences of normal_meta): p4-spec/psa-example-bridged-metadata.p4 at main · p4lang/p4-spec · GitHub
Although the way that Andy mentioned is valid according to the PSA spec, it’s not supported by the eBPF backend yet. We’ll add this feature to the TODO list. In the meantime, I’d suggest prepending a packet with an additional custom packet header carrying bridged metadata, as shown in p4c/bridged-metadata.p4 at main · p4lang/p4c · GitHub.