netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 00/15] bpf: support creating maps on networking devices
@ 2018-01-12  4:29 Jakub Kicinski
  2018-01-12  4:29 ` [PATCH bpf-next v2 01/15] bpf: add map_alloc_check callback Jakub Kicinski
                   ` (15 more replies)
  0 siblings, 16 replies; 20+ messages in thread
From: Jakub Kicinski @ 2018-01-12  4:29 UTC (permalink / raw)
  To: alexei.starovoitov, daniel, davem
  Cc: netdev, oss-drivers, tehnerd, Jakub Kicinski

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.

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.

v2:
 - leave out the array maps, we will add them trivially later to avoid
   merge conflicts with ongoing spectere&meltdown mitigations.

Jakub Kicinski (15):
  bpf: add map_alloc_check callback
  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: 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 helpers for updating immediate instructions
  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       | 163 +++++++-
 drivers/net/ethernet/netronome/nfp/bpf/main.c      |  60 ++-
 drivers/net/ethernet/netronome/nfp/bpf/main.h      |  95 ++++-
 drivers/net/ethernet/netronome/nfp/bpf/offload.c   | 106 ++++-
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c  |  47 +++
 drivers/net/ethernet/netronome/nfp/nfp_app.h       |   9 +
 drivers/net/ethernet/netronome/nfp/nfp_asm.c       |  58 +++
 drivers/net/ethernet/netronome/nfp/nfp_asm.h       |   4 +
 drivers/net/ethernet/netronome/nfp/nfp_net.h       |  12 +
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |   7 +
 include/linux/bpf.h                                |  65 ++-
 include/linux/netdevice.h                          |   6 +
 include/uapi/linux/bpf.h                           |   1 +
 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                               | 224 ++++++++++-
 kernel/bpf/sockmap.c                               |   8 +-
 kernel/bpf/stackmap.c                              |   6 +-
 kernel/bpf/syscall.c                               |  71 +++-
 kernel/bpf/verifier.c                              |   7 +
 tools/include/uapi/linux/bpf.h                     |   1 +
 26 files changed, 1506 insertions(+), 120 deletions(-)
 create mode 100644 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

-- 
2.15.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-01-15  0:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12  4:29 [PATCH bpf-next v2 00/15] bpf: support creating maps on networking devices Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 01/15] bpf: add map_alloc_check callback Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 02/15] bpf: hashtab: move attribute validation before allocation Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 03/15] bpf: hashtab: move checks out of alloc function Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 04/15] bpf: add helper for copying attrs to struct bpf_map Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 05/15] bpf: rename bpf_dev_offload -> bpf_prog_offload Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 06/15] bpf: offload: factor out netdev checking at allocation time Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 07/15] bpf: offload: add map offload infrastructure Jakub Kicinski
2018-01-14 23:37   ` Daniel Borkmann
2018-01-14 23:52     ` Jakub Kicinski
2018-01-14 23:58       ` Daniel Borkmann
2018-01-12  4:29 ` [PATCH bpf-next v2 08/15] nfp: bpf: add map data structure Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 09/15] nfp: bpf: add basic control channel communication Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 10/15] nfp: bpf: implement helpers for FW map ops Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 11/15] nfp: bpf: parse function call and map capabilities Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 12/15] nfp: bpf: add helpers for updating immediate instructions Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 13/15] nfp: bpf: add verification and codegen for map lookups Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 14/15] nfp: bpf: add support for reading map memory Jakub Kicinski
2018-01-12  4:29 ` [PATCH bpf-next v2 15/15] nfp: bpf: implement bpf map offload Jakub Kicinski
2018-01-15  0:00 ` [PATCH bpf-next v2 00/15] bpf: support creating maps on networking devices Daniel Borkmann

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).