Skip to content

Commit

Permalink
MIPS: net: Add BPF JIT
Browse files Browse the repository at this point in the history
This adds initial support for BPF-JIT on MIPS

Tested on mips32 LE/BE and mips64 BE/n64 using
dhcp, ping and various tcpdump filters.

Benchmarking:

Assuming the remote MIPS target uses 192.168.154.181
as its IP address, and the local host uses 192.168.154.136,
the following results can be obtained using the following
tcpdump filter (catches no frames) and a simple
'time ping -f -c 1000000' command.

[root@(none) ~]# tcpdump -p -n -s 0 -i eth0 net 10.0.0.0/24 -d
(000) ldh      [12]
(001) jeq      #0x800           jt 2	jf 8
(002) ld       [26]
(003) and      #0xffffff00
(004) jeq      #0xa000000       jt 16	jf 5
(005) ld       [30]
(006) and      #0xffffff00
(007) jeq      #0xa000000       jt 16	jf 17
(008) jeq      #0x806           jt 10	jf 9
(009) jeq      #0x8035          jt 10	jf 17
(010) ld       [28]
(011) and      #0xffffff00
(012) jeq      #0xa000000       jt 16	jf 13
(013) ld       [38]
(014) and      #0xffffff00
(015) jeq      #0xa000000       jt 16	jf 17
(016) ret      #65535

- BPF-JIT Disabled

real    1m38.005s
user    0m1.510s
sys     0m6.710s

- BPF-JIT Enabled

real    1m35.215s
user    0m1.200s
sys     0m4.140s

[[email protected]: Resolved conflict.]

Signed-off-by: Markos Chandras <[email protected]>
  • Loading branch information
Markos Chandras authored and ralfbaechle committed May 30, 2014
1 parent 8248881 commit c6610de
Show file tree
Hide file tree
Showing 4 changed files with 1,447 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/mips/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ obj- := $(platform-)

obj-y += kernel/
obj-y += mm/
obj-y += net/

ifdef CONFIG_KVM
obj-y += kvm/
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/net/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MIPS networking code

obj-$(CONFIG_BPF_JIT) += bpf_jit.o
Loading

0 comments on commit c6610de

Please sign in to comment.