Closed hi-glenn closed 5 years ago
I have a copy of the raw code in my private clone (chaudron). Will start cleaning it up once I return from PTO.
I have a copy of the raw code in my private clone (chaudron). Will start cleaning it up once I return from PTO.
@chaudron
I have cloned it from your repository.
Thank you.
Hi, @chaudron I have cloned your repo https://github.com/chaudron/xdp-tutorial But I don't compile them successfully. I just have a try basic01~basic04 . They all failed and got a same error:
**common_params.c:11:10: fatal error: linux/if_xdp.h: No such file or directory
And then, I assumed MY_DIR = ../libbpf in the file Makefile of basic01 path. At the same time, I append CFLAGS += -I$(MY_DIR)/include/uapi/ after the line CFLAGS += -I../headers/ in the file common.mk.
The error still exist.
Looks to me as you don't have kernel headers installed properly. For Fedora install kernel-headers and kernel-devel, which will provide the missing file.
Looks to me as you don't have kernel headers installed properly. For Fedora install kernel-headers and kernel-devel, which will provide the missing file.
@PhilippHomann
At the beginging, I think the same as you do.
However, xdp-tutorial is based on libbpf (https://github.com/libbpf/libbpf/tree/master).
I think if I use CFLAGS -I indicate the libbpf headers path, I will not depend on installing kernel-headers and kernel-devel to compile xdp-tutorial successfully .
And, my system is Ubuntu18.04 with linux kernal 4.19.56.
I don't know if I'm right.
Indeed it is based on libbpf, but you still need to have the kernel headers. See https://github.com/xdp-project/xdp-tutorial/blob/master/setup_dependencies.org
Indeed it is based on libbpf, but you still need to have the kernel headers. See https://github.com/xdp-project/xdp-tutorial/blob/master/setup_dependencies.org
Thank you. I see.
As the title said.
Thanks a lot.