ARM: net: JIT compiler for packet filters
Subsystems (5)
PATCH 1/1 ARM: net: JIT compiler for packet filters
Based of Matt Evans's PPC64 implementation.
Supports only ARM mode with EABI.
Supports both little and big endian. Depends on the support for unaligned loads on ARMv7. Does not support all the BPF opcodes that deal with ancillary data. The scratch memory of the filter lives on the stack.
Enabled in the same way as for x86-64 and PPC64:
echo 1 > /proc/sys/net/core/bpf_jit_enable
A value greater than 1 enables opcode output.
Signed-off-by Mircea Gherzan <[email protected]>
--- arch/arm/Kconfig | 1 + arch/arm/Makefile | 1 + arch/arm/net/Makefile | 3 + arch/arm/net/bpf_jit_32.c | 840 +++++++++++++++++++++++++++++++++++++++++++++ arch/arm/net/bpf_jit_32.h | 174 ++++++++++ 5 files changed, 1019 insertions(+), 0 deletions(-) create mode 100644 arch/arm/net/Makefile create mode 100644 arch/arm/net/bpf_jit_32.c create mode 100644 arch/arm/net/bpf_jit_32.h
arch/arm/Kconfig +1 -0
@@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select HAVE_BPF_JIT if (!THUMB2_KERNEL && AEABI) help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and
arch/arm/Makefile +1 -0
@@ -255,6 +255,7 @@ core-$(CONFIG_VFP) += arch/arm/vfp/ # If we have a machine-specific directory, then include it in the build. core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ +core-y += arch/arm/net/ core-y += $(machdirs) $(platdirs) drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
arch/arm/net/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# ARM-specific networking code + +obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o
arch/arm/net/bpf_jit_32.c new file +840 -0
840 lines not on this page · raw message
arch/arm/net/bpf_jit_32.h new file +174 -0
174 lines not on this page · raw message
Signature · 1 line
1.7.7.3