Comments (10)
yes, let me update the docker image to a more recent version.
from p4c-xdp.
I've created a latest docker image, please do:
p4c-xdp# docker pull u9012063/p4xdp
p4c-xdp# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
u9012063/p4xdp latest 1c560c1c6dd8 15 minutes ago 1.54GB
from p4c-xdp.
Great, thanks!
While I pull the new docker image and run the below command in the p4c/extensions/p4c-xdp/tests,
# make
some errors occurred in xdp7.c , and the output is :
[...]
p4c-xdp --Werror -I ../p4include -I../../../backends/ebpf/runtime/ --target xdp -o xdp7.c xdp7.p4;
clang -I ../p4include -I../../../backends/ebpf/runtime/\
-D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \
-Wno-compare-distinct-pointer-types \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-tautological-compare \
-O2 -emit-llvm -g -c xdp7.c -o -| llc -march=bpf -filetype=obj -o xdp7.o
error: xdp7.c:191:34: in function ebpf_filter i32 (%struct.xdp_md*): Looks like the BPF stack limit of 512 bytes is exceeded. Please move large on stack variables into BPF per-cpu array map.
error: xdp7.c:102:20: in function ebpf_filter i32 (%struct.xdp_md*): Looks like the BPF stack limit of 512 bytes is exceeded. Please move large on stack variables into BPF per-cpu array map.
error: xdp7.c:258:47: in function ebpf_filter i32 (%struct.xdp_md*): Looks like the BPF stack limit of 512 bytes is exceeded. Please move large on stack variables into BPF per-cpu array map.
[...]
do you know why this happened?
from p4c-xdp.
Besides, when I run the below command to load the .o file into the kernel :
# ip link set dev lo xdp obj xdp4.o verb
there're some errors occurred :
Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!
Map specification differs from pinned file!
- Size key: 16 (obj) != 8 (pin)
Map 'Ingress_dstmactable' self-check failed!
Error loading maps into kernel!
Error fetching ELF ancillary data!
and the xdp programs after xdp4 have the same probelm.
from p4c-xdp.
You should open different issues.
The stack size is a problem with the way bcc/llvm generate code; we discussed this in #43.
This other error I have never seen.
@williamtu : can you reproduce this error?
from p4c-xdp.
As for the issue about "Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!"
It's due to previous map not being cleaned up.
So probably your previous xdp program uses key=16 byte, and now
ip link set dev lo xdp obj xdp4.o verb
loads a map with key=8 byte.
Can you run commands like:
ip link set dev lo xdp off
and try again?
from p4c-xdp.
Does it work for you?
from p4c-xdp.
I try to shutdown the xdp program using the command . But it doesn't work for me.
Actually, I didn't use the docker image later. I use the command to extend the p4c compiler. And run these programs on my 4.18 kernel , it works.
from p4c-xdp.
Hi, in fact , when I attach the xdp3.o after attach the xdp2.o and deattach the xdp2.o by xdp off command, there's still the same error :
8 bytes struct bpf_elf_map fixup performed due to size mismatch!
and this time , I found that the maps stored in the /sys/fs/bpf/xdp/globals/ still exist . These old maps created by the xdp2.o didn't be deleted by the
ip link set dev ens3 xdp off
After I delete all these old maps, the xdp3.o program can be loaded without any errors.
from p4c-xdp.
I assume that we can close this issue.
from p4c-xdp.
Related Issues (20)
- Unexpected behavior when running xdp3.o HOT 6
- how to implement a forwoading function using XDP_TX based on xdp7.p4 HOT 1
- What is the difference between bpf_obj_get() in libbpf.h and BPF_OBJ_GET() in init_tables() HOT 3
- Could this compiler support XDP_REDIRECT HOT 16
- changing reject to accept introduce stack increaseing HOT 9
- compiler support for lpm HOT 5
- compiler support for range lookup HOT 10
- invalid indirect read from stack off HOT 3
- ebpf_ipv4_checksum Not working HOT 1
- Compiler support for htons, htonl, htonll HOT 2
- Compiler support for registers and hash functions HOT 3
- [doc] Vagrant image name HOT 2
- [Q] Vagrant image HOT 1
- Resource Leak
- Using XDP with clang/llvm version 9 HOT 3
- How to include ebpf_xdp.h HOT 3
- Adding PERCPU_ARRAY Question HOT 2
- p4x-xdp support for PSA HOT 9
- Test 17 fails HOT 1
- XDP metadata support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p4c-xdp.