Skip to content

KnightChaser/ebpf-tailcall-example

Repository files navigation

ebpf-tailcall-example

This project contains C source code to execute multiple functions via eBPF tail calls when a packet arrives.

image

Build

This project is built with Meson (the build system). It requires an eBPF-supported Linux kernel (modern Linux kernels almost support them! :D), bpftool, clang, llvm (I used LLVM 18), libbpf, and libelf.

  1. Create the build directory with meson setup builddir --native-file=clang.ini
  2. Inside the build directory(/builddir), build the project with meson compile.
  3. After that, execute the program via sudo ./xdp_tailcall <NIC interface name>.
image

Print the trace pipe(/sys/kernel/debug/tracing/trace_pipe) and you'll be able to observe program outputs. Those tail-called functions are generated upon every packet arrival at the designated NIC (Network Interface Card).

About

eBPF tail call example with libbpf with XDP(eXpress Data Path)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors