Re: Issues with bpf_trace_printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/29/2017 11:56 PM, Y Song wrote:
I tried the test with the following:
    . fc25 env but booted with latest net-next kernel (my developer env)
    . clang/llvm 5.0 (build from source)
    . latest iproute2 (build from source)
and it works fine.

I suggest you migrate to the latest (or above) environment and it should work.
Otherwise, you could bisect and debug to see which component may have issues.

On Mon, Aug 28, 2017 at 10:53 PM, Zvi Effron <zeffron@xxxxxxxxxxxxx> wrote:
Generic XDP driver was introduced in the 4.12 kernel.
https://kernelnewbies.org/Linux_4.12#head-9f96b5e8262772d5e1908bf335fd25f4c3eec15a
If you run dnf update, it should pull down the 4.12 kernel on Fedora 26.

--Zvi

On Mon, Aug 28, 2017 at 10:39 PM, Y Song <ys114321@xxxxxxxxx> wrote:
I tried on my FC26 VM. I actually got permission denied.
I tried to attach the main interface enp0s3 (acting as eth0).

The kernel is 4.11. I think generic xdp support is not there.
Otherwise people can confirm?
The VM interface enp0s3 (or eth0) may not have driver support for XDP.

On Mon, Aug 28, 2017 at 3:12 PM, Zvi Effron <zeffron@xxxxxxxxxxxxx> wrote:
Full reproduction instructions:

1) Install Fedora 26 server. I chose all of the default options,
except I chose to install latest packages from the network. Otherwise,
just run a dnf update after install. I installed into a VM running on
HyperV
2) Install clang, llvm, and kernel-devel:
     dnf install -y clang llvm kernel-devel
3) Copy the program to xdp_test_kern.c
4) Compile the program into an elf object file:
     clang -S -O2 -Wall -Werror -nostdinc -isystem $(clang
-print-file-name=include) -I /lib/modules/$(uname
-r)/build/arch/x86/include  -I /lib/modules/$(uname
-r)/build/arch/x86/include/generated/uapi  -I /lib/modules/$(uname
-r)/build/arch/x86/include/generated  -I /lib/modules/$(uname
-r)/build/include  -I /lib/modules/$(uname
-r)/build/arch/x86/include/uapi  -I /lib/modules/$(uname
-r)/build/include/uapi  -I /lib/modules/$(uname
-r)/build/include/generated/uapi -include  /lib/modules/$(uname
-r)/build/include/linux/kconfig.h -D __KERNEL__ -c -emit-llvm -o
xdp_test_kern.ll xdp_test_kern.c
     llc -march bpf -filetype obj -o xdp_test_kern.o xdp_test_kern.ll
5) Attach the program to eth0:
     ip link set dev eth0 xdp object xdp_test_kern.o section .text verbose
6) Notice only 0s being printed for data in /sys/kernel/debug/tracing/trace_pipe

As near as I can tell, the driver being used for eth0 is hv_netvsc, in
case it's an issue with the driver.

Any chance you could provide the object file itself that was used
for loading?

So it's basically 4.12 kernel with generic XDP on that driver as
you mentioned, right (must be given hv_netvsc doesn't have native
XDP ...)? Which stable version of that kernel do you use (uname -a)
and which iproute2 version (ip -V)?

Can you reproduce it with a latest iproute2 version from the git
tree, so we can rule out the loader?

What's the output of: sysctl -a 2> /dev/null | grep bpf

Thanks



[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux