Open lneto opened 5 months ago
Would you know the version of bpftool that this command installs? Because I'm currently facing an error where bpf_prog_test_run_opts always returns error 524 and I also have kernel 6.5.0. So, I wonder if it might be related. The current version of bpftool I have installed is 7.2
it will depend on the kernel version..
ubuntu@ubuntu:~/lunatik$ dpkg-query -L linux-tools-$(uname -r)
/.
/usr
/usr/lib
/usr/lib/linux-tools
/usr/lib/linux-tools/6.5.0-41-generic
/usr/share
/usr/share/doc
/usr/share/doc/linux-tools-6.5.0-41-generic
/usr/share/doc/linux-tools-6.5.0-41-generic/copyright
/usr/lib/linux-tools/6.5.0-41-generic/bpftool
/usr/lib/linux-tools/6.5.0-41-generic/cpupower
/usr/lib/linux-tools/6.5.0-41-generic/libperf-jvmti.so
/usr/lib/linux-tools/6.5.0-41-generic/perf
/usr/lib/linux-tools/6.5.0-41-generic/usbip
/usr/lib/linux-tools/6.5.0-41-generic/usbipd
/usr/share/doc/linux-tools-6.5.0-41-generic/changelog.Debian.gz
ubuntu@ubuntu:~/lunatik$ /usr/lib/linux-tools/6.5.0-41-generic/bpftool version
bpftool v7.3.0
using libbpf v1.3
features:
try sudo apt install linux-tools-$(uname -r)
; I've created a PR for this.
you might be also interested in this small article I wrote ;-).
I guess bpftool version isn't what is causing my problem. But thanks for the help anyway!
Actually, could you please also tell me the version of clang and llc you are using? Because I've just tested executing a similar program on Kernel 5.11.0 and with clang-11, and it is working well. While in the other machine I have 6.5.0 and clang-16.
ubuntu@ubuntu:~/lunatik$ clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
ubuntu@ubuntu:~/lunatik$ llc --version
Ubuntu LLVM version 14.0.0
Optimized build.
Default target: aarch64-unknown-linux-gnu
Host CPU: (unknown)
@pvvm did you check your libebpf version? I would recommend you to get it from github, as I pointed in this article:
$ git clone -b v1.4.2 --depth 1 --recurse-submodules https://github.com/xdp-project/xdp-tools.git
$ cd xdp-tools/lib/libbpf/src
$ make
$ sudo DESTDIR=/ make install
$ cd ../../../
$ make libxdp
$ cd xdp-loader
$ make
$ sudo make install
$ cd ../../
Thank you very much for your help! And the article looks pretty good! But I sorted out a way to solve my problem in this post I made
btw, even that it doesn't see related.. just for the records.. I've had a trouble with SEC("xdp_drop_icmp")
and needed to change it to SEC("xdp")
to make it work..
Firstly, thank you very much for this example! I'm opening this issue because it might be useful for others. I tried to run it on Ubuntu 22.04 with kernel 6.5 and I needed to update
linux-tools
as described below: