mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
d84ced97300379c116d53743819b2eb68fa86dd5
Program fails on newer kernels, with error message: libbpf: Netlink-based XDP prog detected, please unload it in order to launch AF_XDP prog ERROR: Can't setup AF_XDP socket "Invalid argument" Since kernel v5.13 libbpf version, when bpf_link support is detected then libbpf/xsk require XDP/BPF programs use this feature. See kernel commit 10397994d30f ("libbpf: xsk: Use bpf_link"). To continue using our netlink-based XDP attach approach, instruct libbpf/xsk to not be in change of loading the BPF-prog. As our XDP-prog is special it also makes to control this ourselves. This is achived with the flag XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD xsk_cfg.libbpf_flags = XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD Remember to update the xskmap manually. Fixes: 10397994d30f ("libbpf: xsk: Use bpf_link") Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Practical BPF examples
This git repository contains a diverse set of practical BPF examples that solve (or demonstrate) a specific use-case using BPF.
It is meant to ease doing rapid prototyping and development, writing C-code BPF programs using libbpf. The goal is to make is easier for developers to get started coding.
Many developers struggle to get a working BPF build environment. The repo enviroment makes it easy to build/compile BPF programs by doing the necessary libbpf setup transparently and detect missing compile dependencies (via the (configure)[configure] script). It is a declared goal to make BPF programming more consumable by detecting and reporting issues (when possible).
Description
Languages
C
93.6%
Shell
4.7%
Makefile
1.6%