From 14b8f0bbe51976d4a9bdd5d0ceccd4d86c6ff9ae Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 10 May 2018 11:23:11 +0100 Subject: [PATCH] doc: add BPF library guide Signed-off-by: Konstantin Ananyev Acked-by: Ferruh Yigit --- MAINTAINERS | 1 + doc/guides/prog_guide/bpf_lib.rst | 38 +++++++++++++++++++++++++++++++ doc/guides/prog_guide/index.rst | 1 + 3 files changed, 40 insertions(+) create mode 100644 doc/guides/prog_guide/bpf_lib.rst diff --git a/MAINTAINERS b/MAINTAINERS index b6edea5984..7a18e0dbf2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1105,6 +1105,7 @@ M: Konstantin Ananyev F: lib/librte_bpf/ F: test/bpf/ F: test/test/test_bpf.c +F: doc/guides/prog_guide/bpf_lib.rst Test Applications diff --git a/doc/guides/prog_guide/bpf_lib.rst b/doc/guides/prog_guide/bpf_lib.rst new file mode 100644 index 0000000000..7c08e6b2d3 --- /dev/null +++ b/doc/guides/prog_guide/bpf_lib.rst @@ -0,0 +1,38 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2018 Intel Corporation. + +Berkeley Packet Filter Library +============================== + +The DPDK provides an BPF library that gives the ability +to load and execute Enhanced Berkeley Packet Filter (eBPF) bytecode within +user-space dpdk application. + +It supports basic set of features from eBPF spec. +Please refer to the +`eBPF spec ` +for more information. +Also it introduces basic framework to load/unload BPF-based filters +on eth devices (right now only via SW RX/TX callbacks). + +The library API provides the following basic operations: + +* Create a new BPF execution context and load user provided eBPF code into it. + +* Destroy an BPF execution context and its runtime structures and free the associated memory. + +* Execute eBPF bytecode associated with provided input parameter. + +* Provide information about natively compiled code for given BPF context. + +* Load BPF program from the ELF file and install callback to execute it on given ethdev port/queue. + +Not currently supported eBPF features +------------------------------------- + + - JIT for non X86_64 platforms + - cBPF + - tail-pointer call + - eBPF MAP + - skb + - external function calls for 32-bit platforms diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 36c62f1f08..3b920e537b 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -53,6 +53,7 @@ Programmer's Guide vhost_lib metrics_lib port_hotplug_framework + bpf_lib source_org dev_kit_build_system dev_kit_root_make_help -- 2.20.1