You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The p4c-ebpf backend generates C code that assumes that the user_meta parameters in the ingress and the egress pipelines have the same type. Below is a small example P4 code containing a non-empty egress pipeline and different types being used for the metadatas:
The following warning is raised when compilation is attempted:
meta_switch.c:477:15: warning: incompatible pointer types assigning to 'struct egress_meta_t *' from 'struct ingress_meta_t *' [-Wincompatible-pointer-types]
user_meta = &(hdrMd->cpumap_usermeta);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
The specification explicitly states that different types are allowed to be used, and the type parameters of the programmable blocks allow different types as well:
It uses the same user-defined metadata type IM and header type IH for all ingress parsers and control blocks. The egress parser and control blocks can use the same types for those things, or different types, as the P4 program author wishes.
All tests in the backends/ebpf/tests directory use the same type for user_meta in both the ingress and the egress pipelines, that's why this issue is not caught by tests.
p4c version: p4c 1.2.4.2 (SHA: 624c6be80 BUILD: RELEASE)
The P4 source file has been attached: meta_switch.zip
The compiler was invoked using the Makefile found at backends/ebpf/runtime/kernel.mk
This issue is related to #4958: both issues mention differences between the specification and the implementation regarding how data can be passed from the ingress to the egress pipeline.
The text was updated successfully, but these errors were encountered:
fruffy
added
bug
This behavior is unintended and should be fixed.
ebpf-psa
Topics related to the eBPF PSA back end
labels
Oct 26, 2024
Thanks for investigating these issues. Unfortunately, it looks like the eBPF-PSA back end is currently not maintained. It might take a while until this issue is fixed.
The p4c-ebpf backend generates C code that assumes that the
user_meta
parameters in the ingress and the egress pipelines have the same type. Below is a small example P4 code containing a non-empty egress pipeline and different types being used for the metadatas:The following warning is raised when compilation is attempted:
The specification explicitly states that different types are allowed to be used, and the type parameters of the programmable blocks allow different types as well:
All tests in the
backends/ebpf/tests
directory use the same type foruser_meta
in both the ingress and the egress pipelines, that's why this issue is not caught by tests.p4c version:
p4c 1.2.4.2 (SHA: 624c6be80 BUILD: RELEASE)
The P4 source file has been attached: meta_switch.zip
The compiler was invoked using the Makefile found at
backends/ebpf/runtime/kernel.mk
This issue is related to #4958: both issues mention differences between the specification and the implementation regarding how data can be passed from the ingress to the egress pipeline.
The text was updated successfully, but these errors were encountered: