Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: oss-drivers@netronome.com, Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 0/9] nfp: bpf: stack support in offload
Date: Mon, 23 Oct 2017 11:58:05 -0700	[thread overview]
Message-ID: <20171023185814.4797-1-jakub.kicinski@netronome.com> (raw)

Hi!

This series brings stack support for offload.

We use the LMEM (Local memory) register file as memory to store
the stack.  Since this is a register file we need to do appropriate
shifts on unaligned accesses.  Verifier's state tracking helps us
with that.

LMEM can't be accessed directly, so we add support for setting
pointer registers through which one can read/write LMEM.

This set does not support accessing the stack when the alignment 
is not known.  This can be added later (most likely using the byte_align 
instructions).  There is also a number of optimizations which have been
left out:
 - in more complex non aligned accesses, double shift and rotation
   can save us a cycle.  This, however, leads to code explosion 
   since all access sizes have to be coded separately;
 - since setting LM pointers costs around 5 cycles, we should be
   tracking their values to make sure we don't move them when
   they're already set correctly for earlier access;
 - in case of 8 byte access aligned to 4 bytes and crossing 
   32 byte boundary but not crossing a 64 byte boundary we don't
   have to increment the pointer, but this seems like a pretty
   rare case to justify the added complexity.


Jakub Kicinski (9):
  nfp: bpf: add helper for emitting nops
  nfp: bpf: refactor nfp_bpf_check_ptr()
  nfp: bpf: add stack write support
  nfp: bpf: add stack read support
  nfp: bpf: optimize the RMW for stack accesses
  nfp: bpf: allow stack accesses via modified stack registers
  nfp: bpf: support accessing the stack beyond 64 bytes
  nfp: bpf: support stack accesses via non-constant pointers
  nfp: bpf: optimize mov64 a little

 drivers/net/ethernet/netronome/nfp/bpf/jit.c      | 357 +++++++++++++++++++++-
 drivers/net/ethernet/netronome/nfp/bpf/main.h     |   8 +
 drivers/net/ethernet/netronome/nfp/bpf/offload.c  |   8 +
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c |  64 +++-
 drivers/net/ethernet/netronome/nfp/nfp_asm.h      |   5 +
 5 files changed, 420 insertions(+), 22 deletions(-)

-- 
2.14.1

             reply	other threads:[~2017-10-23 18:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 18:58 Jakub Kicinski [this message]
2017-10-23 18:58 ` [PATCH net-next 1/9] nfp: bpf: add helper for emitting nops Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 2/9] nfp: bpf: refactor nfp_bpf_check_ptr() Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 3/9] nfp: bpf: add stack write support Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 4/9] nfp: bpf: add stack read support Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 5/9] nfp: bpf: optimize the RMW for stack accesses Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 6/9] nfp: bpf: allow stack accesses via modified stack registers Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 7/9] nfp: bpf: support accessing the stack beyond 64 bytes Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 8/9] nfp: bpf: support stack accesses via non-constant pointers Jakub Kicinski
2017-10-23 18:58 ` [PATCH net-next 9/9] nfp: bpf: optimize mov64 a little Jakub Kicinski
2017-10-24  8:39 ` [PATCH net-next 0/9] nfp: bpf: stack support in offload David Miller

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=20171023185814.4797-1-jakub.kicinski@netronome.com \
    --to=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