Netdev List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/9] bpf: pass device ops as callbacks and remove some ndo_bpf subcommands
@ 2018-11-09 13:03 Quentin Monnet
  2018-11-09 13:03 ` [PATCH bpf-next 1/9] nfp: bpf: move nfp_bpf_analyzer_ops from verifier.c to offload.c Quentin Monnet
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Quentin Monnet @ 2018-11-09 13:03 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann; +Cc: netdev, oss-drivers, Quentin Monnet

For passing device functions for offloaded eBPF programs, there used to
be no place where to store the pointer without making the non-offloaded
programs pay a memory price.

As a consequence, three functions were called with ndo_bpf() through
specific commands. Now that we have struct bpf_offload_dev, and since none
of those operations rely on RTNL, we can turn these three commands into
hooks inside the struct bpf_prog_offload_ops, and pass them as part of
bpf_offload_dev_create().

This patch set changes the offload architecture to do so, and brings the
relevant changes to the nfp and netdevsim drivers.

Quentin Monnet (9):
  nfp: bpf: move nfp_bpf_analyzer_ops from verifier.c to offload.c
  bpf: pass a struct with offload callbacks to bpf_offload_dev_create()
  bpf: call verify_insn from its callback in struct bpf_offload_dev
  bpf: call finalize() from its callback in struct bpf_offload_dev
  bpf: call verifier_prep from its callback in struct bpf_offload_dev
  bpf: pass translate() as a callback and remove its ndo_bpf subcommand
  bpf: pass destroy() as a callback and remove its ndo_bpf subcommand
  bpf: pass prog instead of env to bpf_prog_offload_verifier_prep()
  bpf: do not pass netdev to translate() and prepare() offload callbacks

 drivers/net/ethernet/netronome/nfp/bpf/main.c |  2 +-
 drivers/net/ethernet/netronome/nfp/bpf/main.h |  6 +-
 .../net/ethernet/netronome/nfp/bpf/offload.c  | 34 ++++-----
 .../net/ethernet/netronome/nfp/bpf/verifier.c | 11 +--
 drivers/net/netdevsim/bpf.c                   | 51 +++++++------
 include/linux/bpf.h                           |  8 +-
 include/linux/bpf_verifier.h                  |  2 +-
 include/linux/netdevice.h                     | 12 ---
 kernel/bpf/offload.c                          | 75 +++++++------------
 kernel/bpf/verifier.c                         |  2 +-
 10 files changed, 85 insertions(+), 118 deletions(-)

-- 
2.17.1

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

end of thread, other threads:[~2018-11-09 22:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-09 13:03 [PATCH bpf-next 0/9] bpf: pass device ops as callbacks and remove some ndo_bpf subcommands Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 1/9] nfp: bpf: move nfp_bpf_analyzer_ops from verifier.c to offload.c Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 2/9] bpf: pass a struct with offload callbacks to bpf_offload_dev_create() Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 3/9] bpf: call verify_insn from its callback in struct bpf_offload_dev Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 4/9] bpf: call finalize() " Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 5/9] bpf: call verifier_prep " Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 6/9] bpf: pass translate() as a callback and remove its ndo_bpf subcommand Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 7/9] bpf: pass destroy() " Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 8/9] bpf: pass prog instead of env to bpf_prog_offload_verifier_prep() Quentin Monnet
2018-11-09 13:03 ` [PATCH bpf-next 9/9] bpf: do not pass netdev to translate() and prepare() offload callbacks Quentin Monnet

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