Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org, daniel@iogearbox.net,
	alexei.starovoitov@gmail.com
Cc: oss-drivers@netronome.com, Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH bpf-next v3 0/9] bpf: offload: report device back to user space (take 2)
Date: Wed, 27 Dec 2017 18:39:02 -0800	[thread overview]
Message-ID: <20171228023911.4251-1-jakub.kicinski@netronome.com> (raw)

Hi!

This series is a redo of reporting offload device information to
user space after the first attempt did not take into account name
spaces.  As requested by Kirill offloads are now protected by an
r/w sem.  This allows us to remove the workqueue and free the
offload state fully when device is removed (suggested by Alexei).

Net namespace is reported with a device/inode pair.

The accompanying bpftool support is placed in common code because
maps will have very similar info.  Note that the UAPI information
can't be nicely encapsulated into a struct, because in case we
need to grow the device information the new fields will have to
be added at the end of struct bpf_prog_info, we can't grow
structures in the middle of bpf_prog_info.

v3:
 - use dev_get_by_index();
 - redo ns code (new patch 6).
v2:
 - rework the locking in patch 1 (use RCU instead of locking
   dependencies);
 - grab RTNL for a short time in patch 6;
 - minor update to the test in patch 8.

Jakub Kicinski (9):
  bpf: offload: don't require rtnl for dev list manipulation
  bpf: offload: don't use prog->aux->offload as boolean
  bpf: offload: allow netdev to disappear while verifier is running
  bpf: offload: free prog->aux->offload when device disappears
  bpf: offload: free program id when device disappears
  nsfs: generalize ns_get_path() for path resolution with a task
  bpf: offload: report device information for offloaded programs
  tools: bpftool: report device information for offloaded programs
  selftests/bpf: test device info reporting for bound progs

 drivers/net/ethernet/netronome/nfp/bpf/main.h     |   2 +-
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c |   2 +-
 drivers/net/netdevsim/bpf.c                       |   2 +-
 fs/nsfs.c                                         |  29 ++++-
 include/linux/bpf.h                               |  16 ++-
 include/linux/bpf_verifier.h                      |  16 +--
 include/linux/netdevice.h                         |   4 +-
 include/linux/proc_ns.h                           |   3 +
 include/uapi/linux/bpf.h                          |   3 +
 kernel/bpf/offload.c                              | 147 ++++++++++++++++------
 kernel/bpf/syscall.c                              |  19 ++-
 kernel/bpf/verifier.c                             |  20 ++-
 tools/bpf/bpftool/common.c                        |  52 ++++++++
 tools/bpf/bpftool/main.h                          |   2 +
 tools/bpf/bpftool/prog.c                          |   3 +
 tools/include/uapi/linux/bpf.h                    |   3 +
 tools/testing/selftests/bpf/test_offload.py       | 112 +++++++++++++++--
 17 files changed, 346 insertions(+), 89 deletions(-)

-- 
2.15.1

             reply	other threads:[~2017-12-28  2:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  2:39 Jakub Kicinski [this message]
2017-12-28  2:39 ` [PATCH bpf-next v3 1/9] bpf: offload: don't require rtnl for dev list manipulation Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 2/9] bpf: offload: don't use prog->aux->offload as boolean Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 3/9] bpf: offload: allow netdev to disappear while verifier is running Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 4/9] bpf: offload: free prog->aux->offload when device disappears Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 5/9] bpf: offload: free program id " Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 6/9] nsfs: generalize ns_get_path() for path resolution with a task Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 7/9] bpf: offload: report device information for offloaded programs Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 8/9] tools: bpftool: " Jakub Kicinski
2017-12-28  2:39 ` [PATCH bpf-next v3 9/9] selftests/bpf: test device info reporting for bound progs Jakub Kicinski
2017-12-31 16:01 ` [PATCH bpf-next v3 0/9] bpf: offload: report device back to user space (take 2) Daniel Borkmann

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=20171228023911.4251-1-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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