Mihai Budiu
Mihai Budiu
The bmv2 back-end solves this problem in the same way: it has a calling convention which allows people to extend the language with extern constructs as long as they supply...
p4c_xdp is built on top of the p4c compiler from http://github.com/p4-lang/p4c. The support for CounterArray is in that repository, in backends/ebpf. You are right that Registers are just a bit...
In general it is not sustainable to add special support to the compiler for whatever functions may be needed. One thing we can do, though, is to define a calling...
BTW: if we do this we will probably do it in the ebpf back-end rather than in the xdp back-end, because the xdp back-end automatically inherits all the features of...
This one won't be easy to fix. But 528 < 512 + 32 + 8. I wonder why we use so much stack. The space we need is for: -...
All headers in xdp7.c require a bit more than 74 bytes, a little more than on the wire, since they are unpacked (I didn't count padding, maybe that adds up...
Even that should be large enough. I wonder why we use 528 bytes of stack.
Can you try to replace char source[6] with u8 source[6]? This does not make any sense.
The bug is in the load_byte macro - the cast should be applied to data before adding
can you just print sizeof(headers) and sizeof(headers.ethernet)?