netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org, alexei.starovoitov@gmail.com,
	daniel@iogearbox.net, davem@davemloft.net
Cc: oss-drivers@netronome.com, tehnerd@fb.com,
	Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH bpf-next 00/16] bpf: support creating maps on networking devices
Date: Thu,  4 Jan 2018 22:09:15 -0800	[thread overview]
Message-ID: <20180105060931.30815-1-jakub.kicinski@netronome.com> (raw)

Hi!

This set adds support for creating maps on networking devices.  BPF is
programs+maps, the pure program offload has been around for quite some
time, this patchset adds the map part of the equation.

Maps are allocated on the target device from the start.  There is no
host copy when map is created on the device.  Device maps are represented
by struct bpf_offloaded_map, regardless of type.  Host programs can't
access such maps, access is only possible from a program also loaded
to the same device and/or via the BPF syscall.

Two types of maps are supported - global hash maps and array maps.
Offloaded programs are currently only allowed to perform lookups,
control plane is responsible for populating the maps.

For brevity only infrastructure and basic NFP patches are included.
Target device reporting, netdevsim and tests will follow up as well as
some further optimizations to the NFP code.

Jakub Kicinski (16):
  bpf: add map_alloc_check callback
  bpf: array: move checks out of alloc function
  bpf: hashtab: move attribute validation before allocation
  bpf: hashtab: move checks out of alloc function
  bpf: add helper for copying attrs to struct bpf_map
  bpf: rename bpf_dev_offload -> bpf_prog_offload
  bpf: offload: factor out netdev checking at allocation time
  bpf: offload: add map offload infrastructure
  nfp: hand over to BPF offload app at coarser granularity
  nfp: bpf: add map data structure
  nfp: bpf: add basic control channel communication
  nfp: bpf: implement helpers for FW map ops
  nfp: bpf: parse function call and map capabilities
  nfp: bpf: add verification and codegen for map lookups
  nfp: bpf: add support for reading map memory
  nfp: bpf: implement bpf map offload

 drivers/net/ethernet/netronome/nfp/Makefile        |   1 +
 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c      | 446 +++++++++++++++++++++
 drivers/net/ethernet/netronome/nfp/bpf/fw.h        | 103 +++++
 drivers/net/ethernet/netronome/nfp/bpf/jit.c       | 128 +++++-
 drivers/net/ethernet/netronome/nfp/bpf/main.c      |  65 ++-
 drivers/net/ethernet/netronome/nfp/bpf/main.h      | 100 ++++-
 drivers/net/ethernet/netronome/nfp/bpf/offload.c   | 133 +++++-
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c  |  47 +++
 drivers/net/ethernet/netronome/nfp/nfp_app.h       |  48 +--
 drivers/net/ethernet/netronome/nfp/nfp_net.h       |  12 +
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |  17 +-
 include/linux/bpf.h                                |  65 ++-
 include/linux/netdevice.h                          |   6 +
 include/uapi/linux/bpf.h                           |   1 +
 kernel/bpf/arraymap.c                              |  47 ++-
 kernel/bpf/cpumap.c                                |   8 +-
 kernel/bpf/devmap.c                                |   8 +-
 kernel/bpf/hashtab.c                               | 103 +++--
 kernel/bpf/lpm_trie.c                              |   7 +-
 kernel/bpf/offload.c                               | 225 ++++++++++-
 kernel/bpf/sockmap.c                               |   8 +-
 kernel/bpf/stackmap.c                              |   6 +-
 kernel/bpf/syscall.c                               |  69 +++-
 kernel/bpf/verifier.c                              |   7 +
 tools/include/uapi/linux/bpf.h                     |   1 +
 25 files changed, 1466 insertions(+), 195 deletions(-)
 create mode 100644 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

-- 
2.15.1

             reply	other threads:[~2018-01-05  6:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05  6:09 Jakub Kicinski [this message]
2018-01-05  6:09 ` [PATCH bpf-next 01/16] bpf: add map_alloc_check callback Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 02/16] bpf: array: move checks out of alloc function Jakub Kicinski
2018-01-05 17:21   ` Alexei Starovoitov
2018-01-05 17:40     ` Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 03/16] bpf: hashtab: move attribute validation before allocation Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 04/16] bpf: hashtab: move checks out of alloc function Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 05/16] bpf: add helper for copying attrs to struct bpf_map Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 06/16] bpf: rename bpf_dev_offload -> bpf_prog_offload Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 07/16] bpf: offload: factor out netdev checking at allocation time Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 08/16] bpf: offload: add map offload infrastructure Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 09/16] nfp: hand over to BPF offload app at coarser granularity Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 10/16] nfp: bpf: add map data structure Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 11/16] nfp: bpf: add basic control channel communication Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 12/16] nfp: bpf: implement helpers for FW map ops Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 13/16] nfp: bpf: parse function call and map capabilities Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 14/16] nfp: bpf: add verification and codegen for map lookups Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 15/16] nfp: bpf: add support for reading map memory Jakub Kicinski
2018-01-05  6:09 ` [PATCH bpf-next 16/16] nfp: bpf: implement bpf map offload Jakub Kicinski

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=20180105060931.30815-1-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=tehnerd@fb.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;
as well as URLs for NNTP newsgroup(s).