Coder Social home page Coder Social logo

Comments (10)

williamtu avatar williamtu commented on May 26, 2024

yes, let me update the docker image to a more recent version.

from p4c-xdp.

williamtu avatar williamtu commented on May 26, 2024

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.

kwjjyn avatar kwjjyn commented on May 26, 2024

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.

kwjjyn avatar kwjjyn commented on May 26, 2024

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.

mihaibudiu avatar mihaibudiu commented on May 26, 2024

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.

williamtu avatar williamtu commented on May 26, 2024

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.

williamtu avatar williamtu commented on May 26, 2024

Does it work for you?

from p4c-xdp.

kwjjyn avatar kwjjyn commented on May 26, 2024

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.

kwjjyn avatar kwjjyn commented on May 26, 2024

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.

mihaibudiu avatar mihaibudiu commented on May 26, 2024

I assume that we can close this issue.

from p4c-xdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.