From: Daniel Borkmann <daniel@iogearbox.net>
To: Jakub Kicinski <jakub.kicinski@netronome.com>,
alexei.starovoitov@gmail.com
Cc: oss-drivers@netronome.com, netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next 0/3] nfp: bpf: complete shift supports on NFP JIT
Date: Fri, 18 May 2018 22:32:39 +0200 [thread overview]
Message-ID: <626e7efe-ee68-684b-c59a-32c7cdc799ee@iogearbox.net> (raw)
In-Reply-To: <20180518191211.18670-1-jakub.kicinski@netronome.com>
On 05/18/2018 09:12 PM, Jakub Kicinski wrote:
> Jiong says:
>
> NFP eBPF JIT is missing logic indirect shifts (both left and right) and
> arithmetic right shift (both indirect shift and shift by constant).
>
> This patch adds support for them.
>
> For indirect shifts, shift amount is not specified as constant, NFP needs
> to get the shift amount through the low 5 bits of source A operand in
> PREV_ALU, therefore extra instructions are needed compared with shifts by
> constants.
>
> Because NFP is 32-bit, so we are using register pair for 64-bit shifts and
> therefore would need different instruction sequences depending on whether
> shift amount is less than 32 or not.
>
> NFP branch-on-bit-test instruction emitter is added by this patch set and
> is used for efficient runtime check on shift amount. We'd think the shift
> amount is less than 32 if bit 5 is clear and greater or equal then 32
> otherwise. Shift amount is greater than or equal to 64 will result in
> undefined behavior.
>
> This patch also use range info to avoid generating unnecessary runtime code
> if we are certain shift amount is less than 32 or not.
>
> Jiong Wang (3):
> nfp: bpf: support logic indirect shifts (BPF_[L|R]SH | BPF_X)
> nfp: bpf: support arithmetic right shift by constant (BPF_ARSH |
> BPF_K)
> nfp: bpf: support arithmetic indirect right shift (BPF_ARSH | BPF_X)
>
> drivers/net/ethernet/netronome/nfp/bpf/jit.c | 410 ++++++++++++++++--
> drivers/net/ethernet/netronome/nfp/bpf/main.h | 28 ++
> .../net/ethernet/netronome/nfp/bpf/offload.c | 2 +
> .../net/ethernet/netronome/nfp/bpf/verifier.c | 8 +
> drivers/net/ethernet/netronome/nfp/nfp_asm.h | 18 +-
> 5 files changed, 435 insertions(+), 31 deletions(-)
Applied to bpf-next, thanks guys!
prev parent reply other threads:[~2018-05-18 20:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 19:12 [PATCH bpf-next 0/3] nfp: bpf: complete shift supports on NFP JIT Jakub Kicinski
2018-05-18 19:12 ` [PATCH bpf-next 1/3] nfp: bpf: support logic indirect shifts (BPF_[L|R]SH | BPF_X) Jakub Kicinski
2018-05-18 19:12 ` [PATCH bpf-next 2/3] nfp: bpf: support arithmetic right shift by constant (BPF_ARSH | BPF_K) Jakub Kicinski
2018-05-18 19:12 ` [PATCH bpf-next 3/3] nfp: bpf: support arithmetic indirect right shift (BPF_ARSH | BPF_X) Jakub Kicinski
2018-05-18 20:32 ` Daniel Borkmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=626e7efe-ee68-684b-c59a-32c7cdc799ee@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=alexei.starovoitov@gmail.com \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox