Skip to content

Commit

Permalink
ARM: 7259/3: net: JIT compiler for packet filters
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mgherzan authored and Russell King committed Mar 24, 2012
1 parent 09f05d8 commit ddecdfc
Show file tree
Hide file tree
Showing 5 changed files with 1,110 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Expand Up @@ -34,6 +34,7 @@ config ARM
select GENERIC_IRQ_SHOW
select CPU_PM if (SUSPEND || CPU_IDLE)
select GENERIC_PCI_IOMAP
select HAVE_BPF_JIT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
Expand Down
1 change: 1 addition & 0 deletions arch/arm/Makefile
Expand Up @@ -253,6 +253,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/
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/net/Makefile
@@ -0,0 +1,3 @@
# ARM-specific networking code

obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o

0 comments on commit ddecdfc

Please sign in to comment.