Skip to content

Commit 5bcfedf

Browse files
Daniel Borkmanndavem330
authored andcommitted
net: filter: simplify label names from jump-table
This patch simplifies label naming for the BPF jump-table. When we define labels via DL(), we just concatenate/textify the combination of instruction opcode which consists of the class, subclass, word size, target register and so on. Each time we leave BPF_ prefix intact, so that e.g. the preprocessor generates a label BPF_ALU_BPF_ADD_BPF_X for DL(BPF_ALU, BPF_ADD, BPF_X) whereas a label name of ALU_ADD_X is much more easy to grasp. Pure cleanup only. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dfee07c commit 5bcfedf

2 files changed

Lines changed: 157 additions & 154 deletions

File tree

‎include/linux/filter.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#define BPF_CALL 0x80 /* function call */
3838
#define BPF_EXIT 0x90 /* function return */
3939

40+
/* Placeholder/dummy for 0 */
41+
#define BPF_0 0
42+
4043
/* BPF has 10 general purpose 64-bit registers and stack frame. */
4144
#define MAX_BPF_REG 11
4245

0 commit comments

Comments
 (0)