Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bpfjit



Hi,

I commited bpfjit to amd64 and i386 kernels and I encourage you
to try it out and report any bugs.

bpfjit is a simple compiler of bpf filter programs based on sljit library
(Stack-less Just-In-Time compiler sljit.sf.net). It runs several times
faster than bpf interpreter.

It's disabled by default. To enable it, you should load bpfjit module
and set net.bpf.jit to 1:

# modload bpfjit
# sysctl -w net.bpf.jit=1

Once it's done, all new filter programs will be compiled into binary
code by the kernel and that code will be passed as a hook to watch for
matching packets.

You can see all jit'ed programs using fstat(1):

$ fstat | grep jit
_tcpdump tcpdump    18471    5* bpf rec=97, dr=0, cap=4, pid=18471, promisc, 
seesent, jit, idle

Support for other arches is coming but I don't have hardware to test it
myself. I will ask for support on port-specific mailing lists. Stay
tuned.

sljit (and thus bpfjit) supports the following architectures:

Intel x86-32
AMD x86-64
ARM (Including ARM-v5, ARM-v7 and Thumb2 instruction sets)
IBM PowerPC-32
IBM PowerPC-64
MIPS-32
SPARC

--
Alex


Home | Main Index | Thread Index | Old Index