[External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements.

Stephen Hemminger stephen at networkplumber.org
Sat Jan 6 19:16:11 CET 2024


On Sat, 6 Jan 2024 10:23:57 +0000
Madhuker Mythri <madhuker.mythri at oracle.com> wrote:

> Hi Stephen,
> 
> The new Kernel expects the BPF maps in BTF format: https://www.kernel.org/doc/html/v5.4/bpf/btf.html.
> So, we need to compile with "-g" option as follows:
> ==============================
> clang -O2 -target bpf -c tap_bpf_program.c  -g  -o  tap_bpf_program.o
> =============================
> 
> I had cross check this functionality with DPDK-22.11 and as the BPF C-program is same had modified just the C-program and submitted for review.
> I will update the Makefile changes also and will publish for code-review once again w.r.t DPDK-23.11.
> 
> Thanks,

Makefile needs something like this (from libbpf) to find clang includes.

And bpf extract program then needs to change as well.


# Get Clang's default includes on this system. We'll explicitly add these dirs
# to the includes list when compiling with `-target bpf` because otherwise some
# architecture-specific dirs will be "missing" on some architectures/distros -
# headers such as asm/types.h, asm/byteorder.h, asm/socket.h, asm/sockios.h,
# sys/cdefs.h etc. might be missing.
#
# Use '-idirafter': Don't interfere with include mechanics except where the
# build would have failed anyways.
CLANG_BPF_SYS_INCLUDES ?= $(shell $(CLANG) -v -E - </dev/null 2>&1 \
	| sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }')


More information about the dev mailing list