Netdev List
 help / color / mirror / Atom feed
* [PATCH bpf-next 00/10] bpf: support offload of bpf_event_output()
@ 2018-05-04  1:37 Jakub Kicinski
  2018-05-04  1:37 ` [PATCH bpf-next 01/10] bpf: offload: allow offloaded programs to use perf event arrays Jakub Kicinski
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Jakub Kicinski @ 2018-05-04  1:37 UTC (permalink / raw)
  To: alexei.starovoitov, daniel; +Cc: oss-drivers, netdev, Jakub Kicinski

Hi!

This series centres on NFP offload of bpf_event_output().  The
first patch allows perf event arrays to be used by offloaded
programs.  Next patch makes the nfp driver keep track of such
arrays to be able to filter FW events referring to maps.
Perf event arrays are not device bound.  Having driver
reimplement and manage the perf array seems brittle and unnecessary.

Patch 4 moves slightly the verifier step which replaces map fds
with map pointers.  This is useful for nfp JIT since we can then
easily replace host pointers with NFP table ids (patch 6).  This
allows us to lift the limitation on map helpers having to be used
with the same map pointer on all paths.  Second use of replacing
fds with real host map pointers is that we can use the host map
pointer as a key for FW events in perf event array offload.

Patch 5 adds perf event output offload support for the NFP.

There are some differences between bpf_event_output() offloaded
and non-offloaded version.  The FW messages which carry events
may get dropped and reordered relatively easily.  The return codes
from the helper are also not guaranteed to match the host.  Users
are warned about some of those discrepancies with a one time
warning message to kernel logs.

bpftool gains an ability to dump perf ring events in a very simple
format.  This was very useful for testing and simple debug, maybe
it will be useful to others?

Last patch is a trivial comment fix.


Jakub Kicinski (10):
  bpf: offload: allow offloaded programs to use perf event arrays
  nfp: bpf: record offload neutral maps in the driver
  bpf: export bpf_event_output()
  bpf: replace map pointer loads before calling into offloads
  nfp: bpf: perf event output helpers support
  nfp: bpf: rewrite map pointers with NFP TIDs
  tools: bpftool: fold hex keyword in command help
  tools: bpftool: move get_possible_cpus() to common code
  tools: bpftool: add simple perf event output reader
  bpf: fix references to free_bpf_prog_info() in comments

 drivers/net/ethernet/netronome/nfp/bpf/cmsg.c |  16 +-
 drivers/net/ethernet/netronome/nfp/bpf/fw.h   |  20 +-
 drivers/net/ethernet/netronome/nfp/bpf/jit.c  |  76 +++-
 drivers/net/ethernet/netronome/nfp/bpf/main.c |  28 +-
 drivers/net/ethernet/netronome/nfp/bpf/main.h |  24 +-
 .../net/ethernet/netronome/nfp/bpf/offload.c  | 172 ++++++++-
 .../net/ethernet/netronome/nfp/bpf/verifier.c |  74 +++-
 drivers/net/ethernet/netronome/nfp/nfp_app.c  |   2 +-
 include/linux/bpf.h                           |   5 +
 kernel/bpf/core.c                             |   1 +
 kernel/bpf/offload.c                          |   6 +-
 kernel/bpf/syscall.c                          |   2 +
 kernel/bpf/verifier.c                         |  14 +-
 .../bpf/bpftool/Documentation/bpftool-map.rst |  40 +-
 tools/bpf/bpftool/Documentation/bpftool.rst   |   2 +-
 tools/bpf/bpftool/Makefile                    |   7 +-
 tools/bpf/bpftool/bash-completion/bpftool     |  36 +-
 tools/bpf/bpftool/common.c                    |  77 +++-
 tools/bpf/bpftool/main.h                      |   7 +-
 tools/bpf/bpftool/map.c                       |  80 +---
 tools/bpf/bpftool/map_perf_ring.c             | 347 ++++++++++++++++++
 21 files changed, 912 insertions(+), 124 deletions(-)
 create mode 100644 tools/bpf/bpftool/map_perf_ring.c

-- 
2.17.0

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

end of thread, other threads:[~2018-05-04 22:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-04  1:37 [PATCH bpf-next 00/10] bpf: support offload of bpf_event_output() Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 01/10] bpf: offload: allow offloaded programs to use perf event arrays Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 02/10] nfp: bpf: record offload neutral maps in the driver Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 03/10] bpf: export bpf_event_output() Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 04/10] bpf: replace map pointer loads before calling into offloads Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 05/10] nfp: bpf: perf event output helpers support Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 06/10] nfp: bpf: rewrite map pointers with NFP TIDs Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 07/10] tools: bpftool: fold hex keyword in command help Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 08/10] tools: bpftool: move get_possible_cpus() to common code Jakub Kicinski
2018-05-04  1:37 ` [PATCH bpf-next 09/10] tools: bpftool: add simple perf event output reader Jakub Kicinski
2018-05-04 21:25   ` Alexei Starovoitov
2018-05-04 22:28     ` Jakub Kicinski
2018-05-04 21:53   ` Daniel Borkmann
2018-05-04  1:37 ` [PATCH bpf-next 10/10] bpf: fix references to free_bpf_prog_info() in comments Jakub Kicinski
2018-05-04 21:46 ` [PATCH bpf-next 00/10] bpf: support offload of bpf_event_output() Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox