github.com/cilium/cilium@v1.16.2/Documentation/bpf/index.rst (about) 1 .. only:: not (epub or latex or html) 2 3 WARNING: You are looking at unreleased Cilium documentation. 4 Please use the official rendered version released here: 5 https://docs.cilium.io 6 7 .. _bpf_guide: 8 9 *************************** 10 BPF and XDP Reference Guide 11 *************************** 12 13 .. note:: This documentation section is targeted at developers and users who 14 want to understand BPF and XDP in great technical depth. While 15 reading this reference guide may help broaden your understanding of 16 Cilium, it is not a requirement to use Cilium. Please refer to the 17 :ref:`getting_started` guide and :ref:`ebpf_datapath` for a higher 18 level introduction. 19 20 BPF is a highly flexible and efficient virtual machine-like construct in the 21 Linux kernel allowing to execute bytecode at various hook points in a safe 22 manner. It is used in a number of Linux kernel subsystems, most prominently 23 networking, tracing and security (e.g. sandboxing). 24 25 Although BPF exists since 1992, this document covers the extended Berkeley 26 Packet Filter (eBPF) version which has first appeared in Kernel 3.18 and 27 renders the original version which is being referred to as "classic" BPF 28 (cBPF) these days mostly obsolete. cBPF is known to many as being the packet 29 filter language used by tcpdump. Nowadays, the Linux kernel runs eBPF only and 30 loaded cBPF bytecode is transparently translated into an eBPF representation 31 in the kernel before program execution. This documentation will generally refer 32 to the term BPF unless explicit differences between eBPF and cBPF are being 33 pointed out. 34 35 Even though the name Berkeley Packet Filter hints at a packet filtering specific 36 purpose, the instruction set is generic and flexible enough these days that 37 there are many use cases for BPF apart from networking. See :ref:`bpf_users` 38 for a list of projects which use BPF. 39 40 Cilium uses BPF heavily in its data path, see :ref:`ebpf_datapath` for further 41 information. The goal of this chapter is to provide a BPF reference guide in 42 order to gain understanding of BPF, its networking specific use including loading 43 BPF programs with tc (traffic control) and XDP (eXpress Data Path), and to aid 44 with developing Cilium's BPF templates. 45 46 .. toctree:: 47 :maxdepth: 2 48 49 architecture 50 toolchain 51 debug_and_test 52 progtypes 53 resources