Skip to content

Commit 06edc59

Browse files
Christoph HellwigAlexei Starovoitov
Christoph Hellwig
authored and
Alexei Starovoitov
committed
bpf, docs: Prune all references to "internal BPF"
The eBPF name has completely taken over from eBPF in general usage for the actual eBPF representation, or BPF for any general in-kernel use. Prune all remaining references to "internal BPF". Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20211119163215.971383-4-hch@lst.de
1 parent ccb0029 commit 06edc59

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

Documentation/networking/filter.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ format with similar underlying principles from BPF described in previous
617617
paragraphs is being used. However, the instruction set format is modelled
618618
closer to the underlying architecture to mimic native instruction sets, so
619619
that a better performance can be achieved (more details later). This new
620-
ISA is called 'eBPF' or 'internal BPF' interchangeably. (Note: eBPF which
620+
ISA is called 'eBPF'. (Note: eBPF which
621621
originates from [e]xtended BPF is not the same as BPF extensions! While
622622
eBPF is an ISA, BPF extensions date back to classic BPF's 'overloading'
623623
of BPF_LD | BPF_{B,H,W} | BPF_ABS instruction.)
@@ -690,7 +690,7 @@ Some core changes of the new internal format:
690690
That behavior maps directly to x86_64 and arm64 subregister definition, but
691691
makes other JITs more difficult.
692692

693-
32-bit architectures run 64-bit internal BPF programs via interpreter.
693+
32-bit architectures run 64-bit eBPF programs via interpreter.
694694
Their JITs may convert BPF programs that only use 32-bit subregisters into
695695
native instruction set and let the rest being interpreted.
696696

@@ -711,7 +711,7 @@ Some core changes of the new internal format:
711711
- Introduces bpf_call insn and register passing convention for zero overhead
712712
calls from/to other kernel functions:
713713

714-
Before an in-kernel function call, the internal BPF program needs to
714+
Before an in-kernel function call, the eBPF program needs to
715715
place function arguments into R1 to R5 registers to satisfy calling
716716
convention, then the interpreter will take them from registers and pass
717717
to in-kernel function. If R1 - R5 registers are mapped to CPU registers
@@ -780,7 +780,7 @@ Some core changes of the new internal format:
780780
... since x86_64 ABI mandates rdi, rsi, rdx, rcx, r8, r9 for argument passing
781781
and rbx, r12 - r15 are callee saved.
782782

783-
Then the following internal BPF pseudo-program::
783+
Then the following eBPF pseudo-program::
784784

785785
bpf_mov R6, R1 /* save ctx */
786786
bpf_mov R2, 2
@@ -846,7 +846,7 @@ Some core changes of the new internal format:
846846
bpf_exit
847847

848848
After the call the registers R1-R5 contain junk values and cannot be read.
849-
An in-kernel eBPF verifier is used to validate internal BPF programs.
849+
An in-kernel eBPF verifier is used to validate eBPF programs.
850850

851851
Also in the new design, eBPF is limited to 4096 insns, which means that any
852852
program will terminate quickly and will only call a fixed number of kernel
@@ -861,23 +861,23 @@ A program, that is translated internally consists of the following elements::
861861

862862
op:16, jt:8, jf:8, k:32 ==> op:8, dst_reg:4, src_reg:4, off:16, imm:32
863863

864-
So far 87 internal BPF instructions were implemented. 8-bit 'op' opcode field
864+
So far 87 eBPF instructions were implemented. 8-bit 'op' opcode field
865865
has room for new instructions. Some of them may use 16/24/32 byte encoding. New
866866
instructions must be multiple of 8 bytes to preserve backward compatibility.
867867

868-
Internal BPF is a general purpose RISC instruction set. Not every register and
868+
eBPF is a general purpose RISC instruction set. Not every register and
869869
every instruction are used during translation from original BPF to new format.
870870
For example, socket filters are not using ``exclusive add`` instruction, but
871871
tracing filters may do to maintain counters of events, for example. Register R9
872872
is not used by socket filters either, but more complex filters may be running
873873
out of registers and would have to resort to spill/fill to stack.
874874

875-
Internal BPF can be used as a generic assembler for last step performance
875+
eBPF can be used as a generic assembler for last step performance
876876
optimizations, socket filters and seccomp are using it as assembler. Tracing
877877
filters may use it as assembler to generate code from kernel. In kernel usage
878-
may not be bounded by security considerations, since generated internal BPF code
878+
may not be bounded by security considerations, since generated eBPF code
879879
may be optimizing internal code path and not being exposed to the user space.
880-
Safety of internal BPF can come from a verifier (TBD). In such use cases as
880+
Safety of eBPF can come from a verifier (TBD). In such use cases as
881881
described, it may be used as safe instruction set.
882882

883883
Just like the original BPF, the new format runs within a controlled environment,
@@ -1675,7 +1675,7 @@ Testing
16751675
-------
16761676

16771677
Next to the BPF toolchain, the kernel also ships a test module that contains
1678-
various test cases for classic and internal BPF that can be executed against
1678+
various test cases for classic and eBPF that can be executed against
16791679
the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and
16801680
enabled via Kconfig::
16811681

arch/arm/net/bpf_jit_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static const s8 bpf2a32[][2] = {
163163
[BPF_REG_9] = {STACK_OFFSET(BPF_R9_HI), STACK_OFFSET(BPF_R9_LO)},
164164
/* Read only Frame Pointer to access Stack */
165165
[BPF_REG_FP] = {STACK_OFFSET(BPF_FP_HI), STACK_OFFSET(BPF_FP_LO)},
166-
/* Temporary Register for internal BPF JIT, can be used
166+
/* Temporary Register for BPF JIT, can be used
167167
* for constant blindings and others.
168168
*/
169169
[TMP_REG_1] = {ARM_R7, ARM_R6},

arch/arm64/net/bpf_jit_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static const int bpf2a64[] = {
4444
[BPF_REG_9] = A64_R(22),
4545
/* read-only frame pointer to access stack */
4646
[BPF_REG_FP] = A64_R(25),
47-
/* temporary registers for internal BPF JIT */
47+
/* temporary registers for BPF JIT */
4848
[TMP_REG_1] = A64_R(10),
4949
[TMP_REG_2] = A64_R(11),
5050
[TMP_REG_3] = A64_R(12),

arch/sparc/net/bpf_jit_comp_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static const int bpf2sparc[] = {
227227

228228
[BPF_REG_AX] = G7,
229229

230-
/* temporary register for internal BPF JIT */
230+
/* temporary register for BPF JIT */
231231
[TMP_REG_1] = G1,
232232
[TMP_REG_2] = G2,
233233
[TMP_REG_3] = G3,

kernel/bpf/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ static void bpf_prog_select_func(struct bpf_prog *fp)
18921892

18931893
/**
18941894
* bpf_prog_select_runtime - select exec runtime for BPF program
1895-
* @fp: bpf_prog populated with internal BPF program
1895+
* @fp: bpf_prog populated with BPF program
18961896
* @err: pointer to error variable
18971897
*
18981898
* Try to JIT eBPF program, if JIT is not available, use interpreter.

net/core/filter.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,10 +1242,9 @@ static struct bpf_prog *bpf_migrate_filter(struct bpf_prog *fp)
12421242
int err, new_len, old_len = fp->len;
12431243
bool seen_ld_abs = false;
12441244

1245-
/* We are free to overwrite insns et al right here as it
1246-
* won't be used at this point in time anymore internally
1247-
* after the migration to the internal BPF instruction
1248-
* representation.
1245+
/* We are free to overwrite insns et al right here as it won't be used at
1246+
* this point in time anymore internally after the migration to the eBPF
1247+
* instruction representation.
12491248
*/
12501249
BUILD_BUG_ON(sizeof(struct sock_filter) !=
12511250
sizeof(struct bpf_insn));
@@ -1336,8 +1335,8 @@ static struct bpf_prog *bpf_prepare_filter(struct bpf_prog *fp,
13361335
*/
13371336
bpf_jit_compile(fp);
13381337

1339-
/* JIT compiler couldn't process this filter, so do the
1340-
* internal BPF translation for the optimized interpreter.
1338+
/* JIT compiler couldn't process this filter, so do the eBPF translation
1339+
* for the optimized interpreter.
13411340
*/
13421341
if (!fp->jited)
13431342
fp = bpf_migrate_filter(fp);

0 commit comments

Comments
 (0)