-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BPFireOS: Prog section 'tc_packet_hook0' rejected: Permission denied (13)! R1 type=scalar expected=map_ptr #666
Comments
Hi @vincentmli Is it possible to download the BPFFire OS version you are trying and we can also check it out. We are unable to reproduce this issue in ubuntu or other OS's. |
@UltraInstinct14 do you prefer ISO image or qcow2? I can build one for you, BPFire is clone of IPFire, so once you have the image, it is easy to setup |
here is the raw image I used https://drive.google.com/file/d/1516U6nlDsQgukzDEn1u8y7JZOWHmoA66/view?usp=drive_link, this image has console enabled so when you start it up from libvirt/KVM, and note BPFire/IPFire requires at least two network interfaces, so you can setup two linux bridge interfaces for the guest beforehand
then for the guest
this is the libvirt xml for the BPFire OS I used
|
Thanks will check and update. |
by the way, I assume you used the default clang version from Ubuntu 22.04 to compile the loxilb ebpf object, right? I compiled and installed clang 18.0.0 version on Ubuntu 22.04, sometime clang versions could also make difference. |
Yes using default clang versions - clang10 for Ubuntu20, clang-14 for Ubuntu 22. Not sure of exact version but the default for Ubuntu24 as well. |
it appears different kernel version could have different verifier behavior on the ebpf program, I could try BPFire with latest 6.8 kernel and see if verifier changes on the ebpf program. |
Hi @vincentmli I was able to verify loxilb working in ipfire image. Please find the logs Only change required were to comment any bpf_printk in loxilb. I am not sure but it seems to be commented out in IPfire kernel. I tested by doing the following -
loxilb build system used had Ubuntu-20.04 OS installed which was also used to run ipfire VM image. For bpf_printk issue, I will raise a pull-request soon and link to this issue. |
PR: gh-666 basic support for ipfireOS
@UltraInstinct14 @TrekkieCoder ah, thanks for the finding, now I remember I disabled BPFire kernel tracing and only keep XDP/TC capability, I think bpf_printk requires kernel bpf tracing ipfire/ipfire-2.x@d7544e6 |
@TrekkieCoder could you upload your build binary in #666 (comment) so I can try in a mini PC running BPFire? for some reason, I still have the same issue after cloning and building your newest merge after removing bpf_printk on Ubuntu 22.04 build machine, I could not find 20.04 build system. also maybe you should change your commit message from |
I think I found my problem, I compiled ntc without libbsd since bpfire does not have libbsd addon, after I compiled ntc with libbsd on Ubuntu 22.04 and copied the libbsd to bpfire, it works
|
loxilb or other ebpf program could use bpf_printk for debugging, bpf_printk requires BPF_EVENTS to be enabled, see [0] [0] loxilb-io/loxilb#666 (comment) Signed-off-by: Vincent Li <[email protected]>
Describe the bug
this is follow up issue of #661 where we addressed the cpu_map creation issue of Argument list too long.
so followed the suggested steps below:
the last ntc command generated following
I used llvm-objdump to get more information about the
220: (85) call bpf_map_lookup_elem#1
to find out which map is being looked upllvm-objdump -S /opt/loxilb/llb_ebpf_main.o --section="tc_packet_hook0"
the verifier error
R1 type=scalar expected=map_ptr
seems meaningR1
is expected to be a map pointer address, but R1 is0x0
, right? thefc_v4_map
is created but empty frombpftool map dump name fc_v4_map
, any clue on fixing this issue?To Reproduce
Steps to reproduce the behavior:
build loxilb on Ubuntu 22.04 and copy loxilb binary and loxilb-ebpf object to BPFire OS, and run following steps
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
BPFire OS
6.6.15
0.9.4-beta 2024_05_05-main
bpftool v7.3.0 using libbpf v1.3 features: llvm, skeletons
Additional context
BPFire OS has
libbpf 0.8.3
installed and fixed kernelCONFIG_NR_CPUS
to512
to address #661The text was updated successfully, but these errors were encountered: