netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] bpf: get rid of global verifier state and reuse instruction printer
@ 2017-10-09 17:30 Jakub Kicinski
  2017-10-09 17:30 ` [PATCH net-next v2 1/7] selftests/bpf: add a test for verifier logs Jakub Kicinski
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-10-09 17:30 UTC (permalink / raw)
  To: netdev; +Cc: oss-drivers, alexei.starovoitov, daniel, Jakub Kicinski

Hi!

This set started off as simple extraction of eBPF verifier's instruction
printer into a separate file but evolved into removal of global state.
The purpose of moving instruction printing code is to be able to reuse it
from the bpftool.

As far as the global verifier lock goes, this set removes the global
variables relating to the log buffer, makes the one-time init done
by bpf_get_skb_set_tunnel_proto() not depend on any external locking,
and performs verifier log writeback as data is produced removing the need
for allocating a potentially large temporary buffer.

The final step of actually removing the verifier lock is left to someone
more competent and self-confident :)

Note that struct bpf_verifier_env is just 40B under two pages now,
we should probably switch to vzalloc() when it's expanded again...

v2:
 - add a selftest;
 - use env buffer and flush on every print (Alexei);
 - handle kernel log allocation failures (Daniel);
 - put the env log members into a struct (Daniel).


Jakub Kicinski (7):
  selftests/bpf: add a test for verifier logs
  bpf: encapsulate verifier log state into a structure
  bpf: move global verifier log into verifier environment
  bpf: move instruction printing into a separate file
  tools: bpftool: use the kernel's instruction printer
  bpf: don't rely on the verifier lock for metadata_dst allocation
  bpf: write back the verifier log buffer as it gets filled

 include/linux/bpf_verifier.h                     |  17 +
 include/net/dst_metadata.h                       |   1 +
 kernel/bpf/Makefile                              |   1 +
 kernel/bpf/disasm.c                              | 214 +++++++
 kernel/bpf/disasm.h                              |  32 ++
 kernel/bpf/verifier.c                            | 693 +++++++++--------------
 net/core/dst.c                                   |  16 +
 net/core/filter.c                                |  16 +-
 tools/bpf/bpftool/Documentation/bpftool-prog.rst |  11 +-
 tools/bpf/bpftool/Makefile                       |   7 +-
 tools/bpf/bpftool/main.h                         |  10 +-
 tools/bpf/bpftool/prog.c                         |  44 +-
 tools/testing/selftests/bpf/Makefile             |   2 +-
 tools/testing/selftests/bpf/test_verifier_log.c  | 171 ++++++
 14 files changed, 776 insertions(+), 459 deletions(-)
 create mode 100644 kernel/bpf/disasm.c
 create mode 100644 kernel/bpf/disasm.h
 create mode 100644 tools/testing/selftests/bpf/test_verifier_log.c

-- 
2.14.1

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

end of thread, other threads:[~2017-10-10 21:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09 17:30 [PATCH net-next v2 0/7] bpf: get rid of global verifier state and reuse instruction printer Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 1/7] selftests/bpf: add a test for verifier logs Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 2/7] bpf: encapsulate verifier log state into a structure Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 3/7] bpf: move global verifier log into verifier environment Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 4/7] bpf: move instruction printing into a separate file Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 5/7] tools: bpftool: use the kernel's instruction printer Jakub Kicinski
2017-10-09 17:30 ` [PATCH net-next v2 6/7] bpf: don't rely on the verifier lock for metadata_dst allocation Jakub Kicinski
2017-10-10 21:33   ` kbuild test robot
2017-10-09 17:30 ` [PATCH net-next v2 7/7] bpf: write back the verifier log buffer as it gets filled Jakub Kicinski
2017-10-10 19:30 ` [PATCH net-next v2 0/7] bpf: get rid of global verifier state and reuse instruction printer David Miller

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