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
In the eBPF backend, if the user attempts to write an emit inside an if statement in the deparser's apply block, the generated code is semantically different from the original. For example the following snippet:
control IngressDeparserImpl(packet_out packet,
out empty_t clone_i2e_meta,
out empty_t resubmit_meta,
out empty_t normal_meta,
inout headers hdr,
in metadata meta,
in psa_ingress_output_metadata_t istd)
{
apply {
if (meta.mymd == 0) {
packet.emit(hdr.ethernet);
}
packet.emit(hdr.ipv4);
}
}
Will generate and empty if statement:
if (meta->mymd == 0) {
; }
and completely ignore the emit for the ethernet header
Below is the link to a tarball which has both the P4 program used to reproduce the issue and the generated C eBPF file that will illustrate the bug: emit-bug.tar.gz
In the eBPF backend, if the user attempts to write an emit inside an if statement in the deparser's apply block, the generated code is semantically different from the original. For example the following snippet:
Will generate and empty if statement:
and completely ignore the emit for the ethernet header
Below is the link to a tarball which has both the P4 program used to reproduce the issue and the generated C eBPF file that will illustrate the bug:
emit-bug.tar.gz
The command used to compile was:
./p4c-ebpf --arch psa emit-bug.p4 -o emit-bug.c
I compiled p4c with commit 8273608
The text was updated successfully, but these errors were encountered: