eBPF (sometimes referred to by the acronym BPF, standing for Berkeley Packet Filter) is a technology that can run programs in a privileged context such as the operating system kernel. It is used to safely and efficiently extend the capabilities of the kernel at runtime without requiring changes to kernel source code or loading kernel modules. Safety is provided through an in-kernel verifier which performs static code analysis and rejects programs which crash, hang or otherwise interfere with the kernel negatively. This validation model differs from sandboxed environments, where the execution environment is restricted and the runtime has no insight about the program. Examples of programs that are automatically rejected are programs without strong exit guarantees (i.e. for/while loops without exit conditions) and programs dereferencing pointers without safety-checks. Loaded programs which passed the verifier are either interpreted or in-kernel JIT compiled for native execution performance. The execution model is event-driven and with few exceptions run-to-completion, meaning, programs can be attached to various hook points in the operating system kernel and are run upon triggering of an event. eBPF use cases include (but are not limited to) networking such as XDP, tracing and security subsystems. Given eBPF's efficiency and flexibility opened up new possibilities to solve production issues, Brendan Gregg famously dubbed eBPF "superpowers for Linux". Linus Torvalds said, "BPF has actually been really useful, and the real power of it is how it allows people to do specialized code that isn't enabled until asked for". Due to its success in Linux, the eBPF runtime has been ported to other operating systems such as Windows.
History
Evolution from classic BPF
eBPF was built on top of the Berkeley Packet Filter (cBPF). At the lowest level, it introduced the use of ten 64-bit registers (instead of two 32-bit long registers for cBPF), different jump semantics, a call instruction and corresponding register passing convention, new instructions, and a different encoding for these instructions.
Adoption
eBPF has been adopted by a number of large-scale production users, for example:
Meta uses eBPF through their Katran layer 4 load-balancer for all traffic going to facebook.com Google uses eBPF in GKE, developed and uses BPF LSM to replace audit and it uses eBPF for networking Cloudflare uses eBPF for load-balancing and DDoS protection and security enforcement Netflix uses eBPF for fleet-wide network observability and performance diagnosis Dropbox uses eBPF through Katran for layer 4 load-balancing Android uses eBPF for NAT46 and traffic monitoring Alibaba uses eBPF for Kubernetes Pod load-balancing Datadog uses eBPF for Kubernetes Pod networking and security enforcement Trip.com uses eBPF for Kubernetes Pod networking Microsoft ported eBPF and XDP to Windows Seznam uses eBPF through Cilium for layer 4 load-balancing CapitalOne uses eBPF for Kubernetes Pod networking Apple uses eBPF for Kubernetes Pod security Sky uses eBPF for Kubernetes Pod networking Walmart uses eBPF for layer 4 load-balancing Huawei uses eBPF through their DIGLIM secure boot system Ikea uses eBPF for Kubernetes Pod networking
Logo
The bee is the official logo for eBPF. At the first eBPF Summit there was a vote taken and the bee mascot was named "eBee". The logo has originally been created by Vadim Shchekoldin. Earlier unofficial eBPF mascots have existed in the past, but haven't seen widespread adoption.
Naming
There has been controversy around the naming of eBPF. The alias eBPF is often interchangeably used with BPF, for example by the Linux kernel community. eBPF and BPF is referred to as a technology name like LLVM. eBPF evolved from the Berkeley Packet Filter as an extended version, but its use case outgrew networking, and today eBPF as a pseudo-acronym is preferred.
eBPF Foundation
The eBPF Foundation was created in August 2021 with the goal to expand the contributions being made to extend the powerful capabilities of eBPF and grow beyond Linux. Founding members include Meta, Google, Isovalent, Microsoft and Netflix. The purpose is to raise, budget and spend funds in support of various open source, open data and/or open standards projects relating to eBPF technologies to further drive the growth and adoption of the eBPF ecosystem. Since inception, Red Hat, Huawei, Crowdstrike, Tigera, DaoCloud, Datoms, FutureWei also joined.