2025-10-27 16:01:24 +00:00
2025-10-27 16:07:20 +00:00
2025-10-27 16:16:08 +00:00

l3-forwarding-xdp

L3-L4 xdp based forwarding

xdp-tools is your friend to load xdp in that case.

INSTALL

apt update
apt install clang llvm libbpf-dev libelf-dev pkg-config make git bpftool xdp-tools

Compile

clang -O2 -g -Wall -target bpf \
  -D__BPF_TRACING__ \
  -I/usr/include \
  -I/usr/include/linux \
  -c main.c -o main.o

Attach to the interface

xdp-loader load eth0 ./main.o
xdp-loader status
bpftool map show
bpftool map dump name xdp_flow_stats

bpftool map dump name xdp_flow_stats
Description
L3-L4 xdp based forwarding / offloading for archiving line rates with linux based routers
Readme Apache-2.0 126 KiB
Languages
C 100%