Skip to content

Commit

Permalink
net: filter: simplify label names from jump-table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed May 4, 2014
1 parent dfee07c commit 5bcfedf
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 154 deletions.
3 changes: 3 additions & 0 deletions include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#define BPF_CALL 0x80 /* function call */
#define BPF_EXIT 0x90 /* function return */

/* Placeholder/dummy for 0 */
#define BPF_0 0

/* BPF has 10 general purpose 64-bit registers and stack frame. */
#define MAX_BPF_REG 11

Expand Down
Loading

0 comments on commit 5bcfedf

Please sign in to comment.