[PATCH bpf-next] bpf: Drop redundant CONT_JMP alias
From: Tianci Cao
Date: Mon Mar 23 2026 - 05:06:04 EST
Historically, the classic BPF interpreter distinguished between taken
conditional branches and fall-through paths by using CONT_JMP and CONT,
respectively.
After the interpreter was migrated from net/core/filter.c to
kernel/bpf/core.c, this naming split remained as a historical artifact.
However, both macros have long expanded to the exact same sequence:
"{ insn++; goto select_insn; }".
To simplify the code and remove unnecessary abstractions, replace all
remaining CONT_JMP with CONT, and drop the redundant CONT_JMP definition
entirely.
No functional change intended.
Co-developed-by: Yazhou Tang <tangyazhou518@xxxxxxxxxxx>
Signed-off-by: Yazhou Tang <tangyazhou518@xxxxxxxxxxx>
Co-developed-by: Shenghao Yuan <shenghaoyuan0928@xxxxxxx>
Signed-off-by: Shenghao Yuan <shenghaoyuan0928@xxxxxxx>
Signed-off-by: Tianci Cao <ziye@xxxxxxxxxx>
---
kernel/bpf/core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 229c74f3d6ae..040ce44ba0dd 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1770,7 +1770,6 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn)
u32 tail_call_cnt = 0;
#define CONT ({ insn++; goto select_insn; })
-#define CONT_JMP ({ insn++; goto select_insn; })
select_insn:
goto *jumptable[insn->code];
@@ -2089,25 +2088,25 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn)
JMP_##OPCODE##_X: \
if ((SIGN##64) DST CMP_OP (SIGN##64) SRC) { \
insn += insn->off; \
- CONT_JMP; \
+ CONT; \
} \
CONT; \
JMP32_##OPCODE##_X: \
if ((SIGN##32) DST CMP_OP (SIGN##32) SRC) { \
insn += insn->off; \
- CONT_JMP; \
+ CONT; \
} \
CONT; \
JMP_##OPCODE##_K: \
if ((SIGN##64) DST CMP_OP (SIGN##64) IMM) { \
insn += insn->off; \
- CONT_JMP; \
+ CONT; \
} \
CONT; \
JMP32_##OPCODE##_K: \
if ((SIGN##32) DST CMP_OP (SIGN##32) IMM) { \
insn += insn->off; \
- CONT_JMP; \
+ CONT; \
} \
CONT;
COND_JMP(u, JEQ, ==)
--
2.34.1