eBPF

Virtual machine that allows you to write more efficient and powerful tracing and monitoring for Linux systems.

252 resources9 categoriesView Original

Articles and Presentations(71 items)

A

A BPF reference guide

About BPF C and bcc Python helpers, from bcc repository.

Articles and Presentations
A

A brief introduction to XDP and eBPF

An accessible introduction providing context, history, and details about the functioning of eBPF.

Articles and Presentations
A

A Tour of Program Types

A description of all existing hooks for BPF program types, and of their interest.

Articles and Presentations
A

Advanced programmability and recent updates wit...

Details on eBPF, its use for tunneling and encapsulation, direct packet access, and more.

Articles and Presentations
A

AF_XDP

Kernel documentation on the AF_XDP address family.

Articles and Presentations
B

Beginner's guide to eBPF

A set of live-coding talks and the accompanying code examples, introducing eBPF programming using a variety of libraries and program types.

Articles and Presentations
B

BoF - What Can BPF Do For You?

Articles and Presentations
B

BPF -- in-kernel virtual machine

Presentation by the author of eBPF.

Articles and Presentations
B

BPF and XDP Reference Guide

Guide from the Cilium project.

Articles and Presentations
B

BPF helper functions

A review of the kernel functions that can be called from within eBPF programs.

Articles and Presentations
B

BPF Type Format (BTF)

Kernel documentation about BTF, explaining how to use it.

Articles and Presentations
B

BPF: tracing and more

An introduction mostly covering the tracing aspects.

Articles and Presentations
B

bpfilter: Linux firewall with eBPF sauce

Slides from a talk by Quentin Monnet with a background on eBPF and comparing bpfilter to iptables.

Articles and Presentations
B

Building BPF Programs

Setting up your environment to build BPF programs.

Articles and Presentations
C

Cloudflare's blog posts on eBPF

Different blog posts about networking use cases and low-level aspects of eBPF.

Articles and Presentations
C

cls_bpf/eBPF updates since netdev 1.1

Part of this tc workshop.

Articles and Presentations
C

Communicating with Userspace

How BPF communicates with userspace - BPF maps, perf events, bpftraceprintk.

Articles and Presentations
C

Comprehensive XDP offload---Handling the edge c...

An update on the topic above.

Articles and Presentations
D

Delilah: eBPF-offload on Computational Storage

Delilah is a Computational Storage Processor (CSP) built for eBPF offload to storage devices.

Articles and Presentations
E

eBPF - From a Programmer's Perspective

A short paper describing the fundamentals of eBPF and how to get started with writing eBPF programs.

Articles and Presentations
E

eBPF and XDP walkthrough and recent (2017) updates

Articles and Presentations
E

eBPF/XDP hardware offload to SmartNICs

Hardware offload for eBPF with TC or XDP (Linux kernel 4.9+), introduced by Netronome.

Articles and Presentations
E

Enhancing the Linux kernel with BTF type inform...

A description of the work done with BTF to provide debugging information for BPF programs.

Articles and Presentations
E

eXpress Data Path

Contains some benchmark results obtained with the mlx4 driver.

Articles and Presentations
E

eXpress Data Path (XDP)

The first presentation about XDP.

Articles and Presentations
E

Extending extended BPF

A blog post from 2014 on the development of BPF and demonstrating what can be done with it, using an example of stateful socket filtering by attaching an eBPF program to a socket.

Articles and Presentations
F

Fast Packet Processing in Linux with AF_XDP

Articles and Presentations
F

Ferris Ellis's blog posts about eBPF

They have a few posts about eBPF:

Articles and Presentations
F

Full-system dynamic tracing on Linux using eBPF...

A detailed introduction to tracing with eBPF, from listing the available trace points to running bpftrace programs.

Articles and Presentations
H

hBPF - eBPF in hardware

An eBPF CPU written for FPGAs.

Articles and Presentations
H

High Speed Packet Filtering on Linux

About packet filtering on Linux, DDoS protection, packet processing in the kernel, kernel bypass, XDP and eBPF.

Articles and Presentations
H

How to drop 10 million packets per second

Cloudflare's blog post talking about their move to using XDP for packet filtering.

Articles and Presentations
I

Introducing Cloudflare's BPF Tools

Usage of BPF bytecode with the `xt_bpf` module for iptables.

Articles and Presentations
I

IO Visor

Also introduces IO Visor project.

Articles and Presentations
I

IO Visor blog

Articles and Presentations
L

Libpcap filters syntax

Articles and Presentations
L

Linux BPF Superpowers

An introduction mostly covering the tracing aspects, first part with flame graphs.

Articles and Presentations
L

Linux BPF Superpowers

Brendan Gregg's blog, and in particular article.

Articles and Presentations
L

Linux Extended BPF (eBPF) Tracing Tools

An in-depth collection of information around examples of performance analysis tools using eBPF. Contains also a section at the end of the page about other resources.

Articles and Presentations
L

Linux Kernel Observability through eBPF

A blog post covering the basics of eBPF as well as code samples in Go on how to build and load a minimal eBPF program into the kernel.

Articles and Presentations
L

Linux Kernel Tracing

Systemtap, Kernelshark, trace-cmd, LTTng, perf-tool, ftrace, hist-trigger, perf, function tracer, tracepoint, kprobe/uprobe, and more.

Articles and Presentations
L

Linux Networking Explained

Linux networking internals, with a part about eBPF.

Articles and Presentations
L

Linux tc and eBPF

Articles and Presentations
L

Linux' packet mmap(2), BPF, and Netsniff-NG

Articles and Presentations
M

Making the Kernel's Networking Data Path Progra...

A set of slides covering all the basics about eBPF and XDP (mostly for network processing).

Articles and Presentations
M

Meet-cute between eBPF and Kernel Tracing

Kprobes, uprobes, ftrace.

Articles and Presentations
M

Memory vs. Networking, Provoking and fixing mem...

Advanced details about current memory issues faced by XDP developers.

Articles and Presentations
N

Network Performance Workshop

Additional hints about XDP internals and expected evolution.

Articles and Presentations
O

On getting tc classifier fully programmable wit...

Introduction to eBPF, including several features (map management, tail calls, verifier). The full paper is also available here.

Articles and Presentations
O

OpenCSD eBPF SSD offloading

Computational Storage simulation (QEMU) platform with FUSE LFS filesystem for Zoned Namespaces NVMe SSDs using uBPF for compute kernel offloading, all in userspace.

Articles and Presentations
P

Part 1: Introduction

Articles and Presentations
P

Part 1: Past, Present, and Future

Articles and Presentations
P

Part 2: Machine & Bytecode

Articles and Presentations
P

Part 2: Syscall and Map Types

Articles and Presentations
T

tc and cls bpf: lightweight packet classifying ...

Articles and Presentations
T

The BPF Bytecode and the BPF Verifier

How does BPF ensure that programs are safe?

Articles and Presentations
T

The BSD Packet Filter

An introduction mostly covering the tracing aspects.

Articles and Presentations
T

The BSD Packet Filter: A New Architecture for U...

The original paper about (classic) BPF.

Articles and Presentations
T

The eXpress Data Path

A very accessible introduction to XDP, providing sample code to show how to process packets.

Articles and Presentations
T

The eXpress Data Path: Fast Programmable Packet...

All XDP details in a technical paper: , by Toke Høiland-Jørgensen, Jesper Dangaard Brouer, Daniel Borkmann, John Fastabend, Tom Herbert, David Ahern and David Miller, all being essential eBPF and XDP contributors.

Articles and Presentations
T

The FreeBSD manual page about BPF

Articles and Presentations
U

Using BPF to do Packet Transformation

One eBPF usage about packet transformation.

Articles and Presentations
W

What is BTF (BPF Type Format)

A community-authored newsletter enriched with useful code illustrations and hands-on examples.

Articles and Presentations
W

Why is the kernel community replacing iptables ...

A blog post by Cilium on the motivations behind eBPF and bpfilter, with a couple examples and links to other projects using eBPF and bpfilter.

Articles and Presentations
W

Work-in-progress documentation for XDP

Articles and Presentations
X

XDP for the Rest of Us

How to get started with eBPF and XDP for normal humans. Also summarized by Julia Evans on her blog.

Articles and Presentations
X

XDP now with REDIRECT

Update on XDP, and in particular on the redirect actions.

Articles and Presentations
X

XDP Project overview

Articles and Presentations
X

XDP workshop -- Introduction, experience, and f...

Articles and Presentations
X

XDP – eXpress Data Path, Used for DDoS protection

Details and use cases about XDP, with benchmark results, and code snippets for benchmarking as well as for basic DDoS protection with eBPF/XDP (based on an IP blacklisting scheme).

Articles and Presentations
X

XDP − eXpress Data Path, Intro and future use-c...

Linux Kernel's fight against DPDK. Future plans (as of this writing) for XDP and comparison with DPDK.

Articles and Presentations

Examples(12 items)

B

bcc/examples

Examples coming along with the bcc tools, mostly about tracing.

Examples
B

bcc/tools

These tools themselves can be seen as example use cases for BPF programs, mostly for tracing and monitoring. bcc tools have been packaged for some Linux distributions.

Examples
E

ebpf-kill-example

A fully documented and tested example of an eBPF probe that logs all force-kills and prints them out in user-space.

Examples
E

ebpf-samples

A collection of compiled (as ELF object files) samples gathered from several projects, primarily intended to serve as test cases for user space verifiers.

Examples
I

iproute2/examples/bpf/

Some networking programs to attach to the TC interface.

Examples
L

linux/samples/bpf/

In the kernel tree: some sample eBPF programs.

Examples
L

linux/tools/testing/selftests/bpf

In the kernel tree: Linux BPF selftests, with many eBPF programs.

Examples
M

MPLSinIP sample

A heavily commented sample demonstrating how to encapsulate & decapsulate MPLS within IP. The code is commented for those new to BPF development.

Examples
N

Netronome sample network applications

Provides basic but complete examples of eBPF applications also compatible with hardware offload.

Examples
P

prototype-kernel/kernel/samples/bpf

Jesper Dangaard Brouer's prototype-kernel repository contains some additional examples that can be compiled outside of kernel infrastructure.

Examples
R

redbpf examples

Example programs for using RedBPF to write eBPF programs in Rust.

Examples
X

XDP/TC-eBPF example

Program that uses XDP/TC-eBPF to provide statefull firewalling and socket redirection.

Examples

Reference Documentation(17 items)

A

A List of Research Papers

Reference Documentation
B

BPF Design Q&A

Frequently Asked Questions on the decisions behind the BPF infrastructure.

Reference Documentation
B

BPF Documentation

Index for BPF-related documentation coming with the Linux kernel.

Reference Documentation
B

BPF Verifier Overview

Reference Documentation
B

bpf.h and you...

Reference Documentation
C

Cilium's BPF and XDP Reference Guide

In-depth documentation about most features and aspects of eBPF.

Reference Documentation
C

Contextually speaking...

Reference Documentation
E

ebpf.io

A gateway to discover all the basics of eBPF, including a listing of the main related projects and of community resources.

Reference Documentation
H

HOWTO interact with BPF subsystem

Frequently Asked Questions about contributing to eBPF development.

Reference Documentation
I

IO Visor's Unofficial eBPF spec

Summary of eBPF syntax and operation codes.

Reference Documentation
J

Jesper Dangaard Brouer's documentation

Work in progress, contributions welcome.

Reference Documentation
L

linux/Documentation/networking/filter.rst

eBPF specification (somewhat outdated; information should still be valid, but not exhaustive).

Reference Documentation
L

List of BPF features per kernel version

Reference Documentation
X

xdp-newbies

Emails from David Miller to the mailing list

Reference Documentation
`

`bpf(2)`

Manual page about the `bpf()` system call, used to manage BPF programs and maps from userspace.

Reference Documentation
`

`bpf-helpers(7)` man page

Description of the in-kernel helper functions forming the BPF standard library.

Reference Documentation
`

`tc-bpf(8)`

Manual page about using BPF with tc, including example commands and samples of code.

Reference Documentation

The Code(13 items)

L

linux/arch/x86/net/bpf_jit_comp.c

The JIT compilers are under the directory of their respective architectures, such as file for x86\. Exception is made for JIT compilers used for hardware offload, sitting in their drivers, such as for Netronome NFP.

The Code
L

linux/drivers/net/ethernet/netronome/nfp/bpf/jit.c

The JIT compilers are under the directory of their respective architectures, such as file for x86\. Exception is made for JIT compilers used for hardware offload, sitting in their drivers, such as for Netronome NFP.

The Code
L

linux/include/linux/bpf.h

with linux/include/uapi/bpf.h: definitions related to eBPF, to be used respectively in the kernel and to interface with userspace programs.

The Code
L

linux/include/linux/filter.h

with linux/include/uapi/filter.h: information used to run the BPF programs themselves.

The Code
L

linux/kernel/bpf/

This directory contains most of BPF-related code. In particular, those files are worth of interest:

The Code
L

linux/kernel/seccomp.c

The Code
L

linux/kernel/trace/bpf_trace.c

Functions and eBPF helpers related to tracing and monitoring (kprobes, tracepoints, etc.).

The Code
L

linux/net/core/dev.c

contains the function `devchangexdp_fd()` that is called through a Netlink command to hook a XDP program to a device, after is has been loaded into the kernel from user space. This function in turns uses a callback from the relevant driver.

The Code
L

linux/net/core/filter.c

Functions and eBPF helpers related to networking (TC, XDP etc.); also contains the code to migrate cBPF bytecode to eBPF (all cBPF programs are translated to eBPF in recent kernels).

The Code
L

linux/net/sched/

and in particular in files `actbpf.c` (action) and `clsbpf.c` (filter): code related to BPF actions and filters with TC.

The Code
`

`core.c`

BPF interpreter.

The Code
`

`syscall.c`

Different operations permitted by the system call, such as program loading or map management.

The Code
`

`verifier.c`

BPF verifier.

The Code

Tutorials(26 items)

A

A Deep Dive into eBPF: Writing an Efficient DNS...

A detailed explanation of methods used to capture DNS requests at the socket filter layer.

Tutorials
A

Accelerating Local Socket Communication using eBPF

Learn how eBPF can speed-up local socket communication up to 30%.

Tutorials
A

All your tracing are belong to BPF

A step-by-step walkthrough to integrate tracing capabilities in your C++ applications with the LLVM libraries.

Tutorials
B

bcc Python Developer Tutorial

Comes with bcc, but targets the Python bits across seventeen "lessons".

Tutorials
B

bcc Reference Guide

Many incremental steps to start using bcc and eBPF, mostly centered on tracing and monitoring.

Tutorials
B

Building BPF applications with libbpf-bootstrap

Helps generate minimal or advanced templates to bootstrap your own applications (kernel side and user space management for maps and programs) with features like CO-RE, global variables, and ring buffer.

Tutorials
C

Can eBPF Detect Redis Message Patterns Before T...

A step-by-step guide how eBPF can observe Redis communication between client and server.

Tutorials
C

Catch Performance Regressions in eBPF

A step-by-step guide to benchmarking both the client and kernel eBPF code written in Rust.

Tutorials
E

eBPF Developer Tutorial - Learn eBPF by examples

Start with eBPF basics and progress to advanced topics using 20+ hands-on tutorials and examples. Covers performance, networking, and security with libbpf and CO-RE. Available in Chinese and English.

Tutorials
E

eBPF-Powered Load Balancing

Learn how eBPF can infer custom load-balancing for services listening on the same port, through the SO_REUSEPORT TCP option.

Tutorials
F

Firewalling with BPF/XDP: Examples and Deep Dive

A simple guide to build basic firewalls with TC and XDP.

Tutorials
H

How I ended up writing opensnoop in pure C usin...

A thorough walk-through of how to write eBPF programs, first using only bpf() syscall, and then libbpf library, with reproducible code examples.

Tutorials
I

Inspektor Gadget - Hello world gadget

An introductory guide to writing image-based eBPF gadgets and sharing them via OCI registries.

Tutorials
I

Inspektor Gadget - Hello world gadget with Wasm

An introductory guide to writing image-based eBPF gadgets and performing post-processing with WASM.

Tutorials
L

Linux Tracing Workshops Materials

Involves the use of several BPF tools for tracing.

Tutorials
L

Load XDP programs using the ip (iproute2) command

Tutorials
L

Loops and Iterators in eBPF

Newsletter about all the ways to loop and iterate in eBPF.

Tutorials
O

Open NFP platform

Operated by Netronome: some tutorials for network-related eBPF use cases, including an eBPF Offload Starting Guide.

Tutorials
T

Tracing a packet journey using Linux tracepoint...

Troubleshooting ping requests and replies with perf and bcc programs.

Tutorials
T

Transparent Proxy Implementation using eBPF and Go

A step-by-step guide on how to implement a transparent proxy using eBPF.

Tutorials
U

Unit Testing eBPF Programs

Learn how you can unit test your eBPF programs using libbpf.

Tutorials
W

What Insights Can eBPF Provide into Real-Time S...

A step-by-step guide how eBPF can observe encrypted network traffic.

Tutorials
W

Writing a basic continuous profiler

A step-by-step guide to write an appliation continuous profiler leveraging the eBPF instrumentation, with a complete project as a reference.

Tutorials
X

XDP for the Rest of Us

First edition of a workshop to get started with XDP.

Tutorials
X

XDP for the Rest of Us

Second edition, with new contents.

Tutorials
X

XDP Hands-On Tutorial

A progressive (three levels of difficulty) tutorial to learn how to process packets with XDP.

Tutorials

eBPF Workflow: Tools and Utilities(31 items)

A

A generic implementation

With support for FreeBSD kernel, FreeBSD user space, Linux kernel, Linux user space and macOS user space. Used for the VALE software switch's BPF extension module.

eBPF Workflow: Tools and Utilities
A

A Vagrant setup

To easily test XDP. Less useful now that generic XDP (driver-independant, mostly for testing) exists.

eBPF Workflow: Tools and Utilities
A

aya

A pure Rust library for writing, loading, and managing eBPF objects, with a focus on developer experience and operability. It supports writing eBPF programs in Rust and distributing library code over crates.io to share it between eBPF programs. Aya does not depend on libbpf.

eBPF Workflow: Tools and Utilities
A

aya-template

Templates for writing BPF applications in Aya that can be used with `cargo generate`.

eBPF Workflow: Tools and Utilities
B

bcc

Framework and set of tools - One way to handle BPF programs, in particular for tracing and monitoring. Also includes some utilities that may help inspect maps or programs on the system.

eBPF Workflow: Tools and Utilities
B

bcc in a Docker container

eBPF Workflow: Tools and Utilities
B

bpftool

Also some other tools in the kernel tree, under linux/tools/net/ for versions earlier than 4.15, or linux/tools/bpf/ after that:

eBPF Workflow: Tools and Utilities
C

cilium/ebpf

Pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.

eBPF Workflow: Tools and Utilities
E

eBPF for Windows

This project is a work-in-progress that allows using existing eBPF toolchains and APIs familiar in the Linux ecosystem to be used on top of Windows.

eBPF Workflow: Tools and Utilities
E

Ebpfguard

Rust library for writing Linux security policies using eBPF.

eBPF Workflow: Tools and Utilities
E

eunomia-bpf

A compilation framework and runtime library to build, distribute, dynamically load, and run CO-RE eBPF applications in multiple languages and WebAssembly. It supports writing eBPF kernel code only (to build simple CO-RE libbpf eBPF applications), writing the kernel part in both BCC and libbpf styles, and writing userspace in multiple languages in a WASM module and distributing it with simple JSON data or WASM OCI images. The runtime is based on libbpf only and provides CO-RE to BCC-style eBPF programs wi...

eBPF Workflow: Tools and Utilities
G

gobpf

Go bindings for BCC for creating eBPF programs.

eBPF Workflow: Tools and Utilities
I

iproute2

Package containing tools for network management on Linux. In particular, it contains `tc`, used to manage eBPF filters and actions, and `ip`, used to manage XDP programs. Most of the code related to BPF is in lib/bpf.c.

eBPF Workflow: Tools and Utilities
I

iproute2-next

The development tree, synchronised with net-next.

eBPF Workflow: Tools and Utilities
L

libbpf

A C library used for handling BPF objects (programs and maps), and manipulating ELF object files containing them. It is shipped with the kernel and mirrored on GitHub.

eBPF Workflow: Tools and Utilities
L

libbpf-bootstrap

Scaffolding for BPF application development with libbpf and BPF CO-RE.

eBPF Workflow: Tools and Utilities
L

libbpfgo

eBPF library for Go, powered by libbpf.

eBPF Workflow: Tools and Utilities
L

LLVM

Contains several tools used in eBPF workflows. Snapshots of the latest versions for Ubuntu/Debian can be retrieved from here.

eBPF Workflow: Tools and Utilities
L

Lua front-end for BCC

Another alternative to C, and even to most of the Python code used in bcc.

eBPF Workflow: Tools and Utilities
O

oster

Written in Go. A tool for tracing execution of Go programs by attaching eBPF to uprobes.

eBPF Workflow: Tools and Utilities
O

oxidebpf

A pure Rust library for managing eBPF programs, designed for security use cases. The featureset is more limited than other libraries but emphasizes stability across a wide range of kernels and backwards-compatible compile-once-run-most-places.

eBPF Workflow: Tools and Utilities
P

PREVAIL

A user space verifier for eBPF using an abstract interpretation layer, with support for loops.

eBPF Workflow: Tools and Utilities
R

rbpf

Written in Rust. Interpreter for Linux, macOS and Windows, and JIT-compiler for x86_64 under Linux.

eBPF Workflow: Tools and Utilities
T

this commit

clang is used to compile C to eBPF object file under the ELF format (clang v3.7.1+). The BPF backend was added with .

eBPF Workflow: Tools and Utilities
U

uBPF

Written in C. Contains an interpreter, a JIT compiler for x86_64 architecture, an assembler and a disassembler.

eBPF Workflow: Tools and Utilities
W

wachy

A tracing profiler that aims to make eBPF uprobe-based debugging easier to use. This is done by displaying traces in a UI next to the source code and allowing interactive drilldown analysis.

eBPF Workflow: Tools and Utilities
Z

zbpf

A pure Zig framework for writing cross platform eBPF programs, powered by libbpf and Zig toolchain.

eBPF Workflow: Tools and Utilities
`

`bpftool`

A generic utility that can be used to interact with eBPF programs and maps from userspace, for example to show, dump, load, disassemble, pin programs, or to show, create, pin, update, delete maps, or to attach and detach programs to cgroups.

eBPF Workflow: Tools and Utilities
`

`bpf_asm`

A minimal cBPF assembler.

eBPF Workflow: Tools and Utilities
`

`bpf_dbg`

A small debugger for cBPF programs.

eBPF Workflow: Tools and Utilities
`

`bpf_jit_disasm`

A disassembler for both BPF flavors and could be highly useful for JIT debugging.

eBPF Workflow: Tools and Utilities