Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416704

Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

From Alexei Starovoitov <alexei.starovoitov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF
Date 2016-06-08 01:00 +0200
Message-ID <rHy8y-dV-1@gated-at.bofh.it> (permalink)
References <rHpoB-3hJ-11@gated-at.bofh.it> <rHpoC-3hJ-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 07, 2016 at 07:02:23PM +0530, Naveen N. Rao wrote:
> PPC64 eBPF JIT compiler.
> 
> Enable with:
> echo 1 > /proc/sys/net/core/bpf_jit_enable
> or
> echo 2 > /proc/sys/net/core/bpf_jit_enable
> 
> ... to see the generated JIT code. This can further be processed with
> tools/net/bpf_jit_disasm.
> 
> With CONFIG_TEST_BPF=m and 'modprobe test_bpf':
> test_bpf: Summary: 305 PASSED, 0 FAILED, [297/297 JIT'ed]
> 
> ... on both ppc64 BE and LE.

Nice. That's even better than on x64 which cannot jit one test:
test_bpf: #262 BPF_MAXINSNS: Jump, gap, jump, ... jited:0 168 PASS
which was designed specifically to hit x64 jit pass limit.
ppc jit has predicatble number of passes and doesn't have this problem
as expected. Great.

> The details of the approach are documented through various comments in
> the code.
> 
> Cc: Matt Evans <matt@ozlabs.org>
> Cc: Denis Kirjanov <kda@linux-powerpc.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig                  |   3 +-
>  arch/powerpc/include/asm/asm-compat.h |   2 +
>  arch/powerpc/include/asm/ppc-opcode.h |  20 +-
>  arch/powerpc/net/Makefile             |   4 +
>  arch/powerpc/net/bpf_jit.h            |  53 +-
>  arch/powerpc/net/bpf_jit64.h          | 102 ++++
>  arch/powerpc/net/bpf_jit_asm64.S      | 180 +++++++
>  arch/powerpc/net/bpf_jit_comp64.c     | 956 ++++++++++++++++++++++++++++++++++
>  8 files changed, 1317 insertions(+), 3 deletions(-)
>  create mode 100644 arch/powerpc/net/bpf_jit64.h
>  create mode 100644 arch/powerpc/net/bpf_jit_asm64.S
>  create mode 100644 arch/powerpc/net/bpf_jit_comp64.c

don't see any issues with the code.
Thank you for working on this.

Acked-by: Alexei Starovoitov <ast@kernel.org>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] eBPF JIT for PPC64 "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-07 15:40 +0200
  [PATCH 3/6] ppc: bpf/jit: Introduce rotate immediate instructions "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-07 17:40 +0200
  Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended  BPF Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-06-08 01:00 +0200
    Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended  BPF "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-08 19:20 +0200
  Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended  BPF "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-09 08:10 +0200
  Re: [PATCH 0/6] eBPF JIT for PPC64 David Miller <davem@davemloft.net> - 2016-06-11 07:50 +0200

csiph-web