Lines Matching refs:P4
1 # Compiling P4 to EBPF
10 written in the P4 programming languages to eBPF programs. The
20 In this section we give a brief overview of P4 and EBPF. A detailed
23 ### P4 subsection
25 P4 (http://p4.org) is a domain-specific programming language for
33 P4 itself is protocol-independent but allows programmers to express a
34 rich set of data plane behaviors and protocols. The core P4
43 * Tables associate keys to actions. P4 tables generalize traditional
63 P4 programs describe the behavior of network-processing dataplanes. A
64 P4 program is designed to operate in concert with a separate *control
66 runtime the contents of the P4 tables. P4 cannot be used to specify
67 control-planes; however, a P4 program implicitly specifies the
70 The P4 language is under active development; the current stable
155 new capabilities are added frequently. The P4 compiler generates code
159 ## Compiling P4 to EBPF
161 From the above description it is apparent that the P4 and EBPF
167 ![P4 and EBPF overlap in capabilities](scope.png)
169 We expect that the overlapping region will grow in size as both P4 and
172 The current version of the P4 to EBPF compiler translates programs
173 written in the version 1.1 of the P4 programming language to programs
179 P4 ---> | P4-to-EBPF | ---> C ----> | BCC | --> EBPF
183 The P4 program only describes the packet processing *data plane*, that
193 In order to use the P4 to EBPF compiler the following software must be installed:
198 * the P4 compiler front-end: (https://github.com/p4lang/p4-hlir).
199 This is required for parsing the P4 programs.
207 The P4 to EBPF compiler generates code that is designed for being used
216 The current version of the P4 to EBPF compiler supports a relatively
217 narrow subset of the P4 language, but still powerful enough to write
229 Here are some limitations imposed on the P4 programs:
231 * Currently both the ingress and the egress P4 pipelines are executed
246 * P4 cloning and recirculation and not supported
254 ### Translating P4 to C
256 To simplify the translation, the P4 programmer should refrain using
259 The following table provides a brief summary of how each P4 construct
264 P4 Construct | C Translation
275 P4 Construct | C Translation
294 * `testP4toEbpf.py`: which compiles all P4 files in the testprograms folder
304 with a suitable input P4 file:
312 The P4 compiler first runs the C preprocessor on the input P4 file.
328 * `-g filter` generates a filter; the only P4 action that has an
329 effect is the `drop()` action. Setting metadata in P4 (e.g.,
338 a C function named `ebpf_filter` that implements the P4-specified
341 the P4 to EBPF source code for an in-depth understanding. A minimal