Skip to content

Commit ddecdfc

Browse files
mgherzanRussell King
authored andcommitted
ARM: 7259/3: net: JIT compiler for packet filters
Based of Matt Evans's PPC64 implementation. The compiler generates ARM instructions but interworking is supported for Thumb2 kernels. Supports both little and big endian. Unaligned loads are emitted for ARMv6+. Not all the BPF opcodes that deal with ancillary data are supported. The scratch memory of the filter lives on the stack. Hardware integer division is used if it is available. 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 <mgherzan@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 09f05d8 commit ddecdfc

5 files changed

Lines changed: 1110 additions & 0 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ config ARM
3434
select GENERIC_IRQ_SHOW
3535
select CPU_PM if (SUSPEND || CPU_IDLE)
3636
select GENERIC_PCI_IOMAP
37+
select HAVE_BPF_JIT
3738
help
3839
The ARM series is a line of low-power-consumption RISC chip designs
3940
licensed by ARM Ltd and targeted at embedded applications and

‎arch/arm/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ core-$(CONFIG_VFP) += arch/arm/vfp/
253253

254254
# If we have a machine-specific directory, then include it in the build.
255255
core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
256+
core-y += arch/arm/net/
256257
core-y += $(machdirs) $(platdirs)
257258

258259
drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/

‎arch/arm/net/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ARM-specific networking code
2+
3+
obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o

0 commit comments

Comments
 (0)