bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 00/10] bpf_link observability APIs
@ 2020-04-28  5:49 Andrii Nakryiko
  2020-04-28  5:49 ` [PATCH v2 bpf-next 01/10] bpf: refactor bpf_link update handling Andrii Nakryiko
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Andrii Nakryiko @ 2020-04-28  5:49 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

This patch series adds various observability APIs to bpf_link:
  - each bpf_link now gets ID, similar to bpf_map and bpf_prog, by which
    user-space can iterate over all existing bpf_links and create limited FD
    from ID;
  - allows to get extra object information with bpf_link general and
    type-specific information;
  - implements `bpf link show` command which lists all active bpf_links in the
    system;
  - implements `bpf link pin` allowing to pin bpf_link by ID or from other
    pinned path.

v1->v2:
  - simplified `bpftool link show` implementation (Quentin);
  - fixed formatting of bpftool-link.rst (Quentin);
  - fixed attach type printing logic (Quentin);
rfc->v1:
  - dropped read-only bpf_links (Alexei);
  - fixed bug in bpf_link_cleanup() not removing ID;
  - fixed bpftool link pinning search logic;
  - added bash-completion and man page.

Andrii Nakryiko (10):
  bpf: refactor bpf_link update handling
  bpf: allocate ID for bpf_link
  bpf: support GET_FD_BY_ID and GET_NEXT_ID for bpf_link
  bpf: add support for BPF_OBJ_GET_INFO_BY_FD for bpf_link
  libbpf: add low-level APIs for new bpf_link commands
  selftests/bpf: test bpf_link's get_next_id, get_fd_by_id, and
    get_obj_info
  bpftool: expose attach_type-to-string array to non-cgroup code
  bpftool: add bpf_link show and pin support
  bpftool: add bpftool-link manpage
  bpftool: add link bash completions

 include/linux/bpf-cgroup.h                    |  14 -
 include/linux/bpf.h                           |  28 +-
 include/linux/bpf_types.h                     |   6 +
 include/uapi/linux/bpf.h                      |  31 ++
 kernel/bpf/btf.c                              |   2 +
 kernel/bpf/cgroup.c                           |  89 ++++-
 kernel/bpf/syscall.c                          | 363 ++++++++++++++----
 kernel/bpf/verifier.c                         |   2 +
 kernel/cgroup/cgroup.c                        |  27 --
 .../bpftool/Documentation/bpftool-link.rst    | 118 ++++++
 tools/bpf/bpftool/bash-completion/bpftool     |  39 ++
 tools/bpf/bpftool/cgroup.c                    |  48 +--
 tools/bpf/bpftool/common.c                    |   2 +
 tools/bpf/bpftool/link.c                      | 333 ++++++++++++++++
 tools/bpf/bpftool/main.c                      |   6 +-
 tools/bpf/bpftool/main.h                      |  37 ++
 tools/include/uapi/linux/bpf.h                |  31 ++
 tools/lib/bpf/bpf.c                           |  19 +-
 tools/lib/bpf/bpf.h                           |   4 +-
 tools/lib/bpf/libbpf.map                      |   6 +
 .../selftests/bpf/prog_tests/bpf_obj_id.c     | 110 +++++-
 .../testing/selftests/bpf/progs/test_obj_id.c |  14 +-
 22 files changed, 1145 insertions(+), 184 deletions(-)
 create mode 100644 tools/bpf/bpftool/Documentation/bpftool-link.rst
 create mode 100644 tools/bpf/bpftool/link.c

-- 
2.24.1


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

end of thread, other threads:[~2020-04-29  0:11 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  5:49 [PATCH v2 bpf-next 00/10] bpf_link observability APIs Andrii Nakryiko
2020-04-28  5:49 ` [PATCH v2 bpf-next 01/10] bpf: refactor bpf_link update handling Andrii Nakryiko
2020-04-28  5:49 ` [PATCH v2 bpf-next 02/10] bpf: allocate ID for bpf_link Andrii Nakryiko
2020-04-28 17:31   ` Alexei Starovoitov
2020-04-28 18:56     ` Andrii Nakryiko
2020-04-28 20:38       ` Alexei Starovoitov
2020-04-28 22:33         ` Andrii Nakryiko
2020-04-28 22:43           ` Alexei Starovoitov
2020-04-28 23:25             ` Andrii Nakryiko
2020-04-29  0:11               ` Alexei Starovoitov
2020-04-28  5:49 ` [PATCH v2 bpf-next 03/10] bpf: support GET_FD_BY_ID and GET_NEXT_ID " Andrii Nakryiko
2020-04-28  5:49 ` [PATCH v2 bpf-next 04/10] bpf: add support for BPF_OBJ_GET_INFO_BY_FD " Andrii Nakryiko
2020-04-28  9:46   ` Toke Høiland-Jørgensen
2020-04-28 16:27     ` Andrii Nakryiko
2020-04-28 18:31       ` Toke Høiland-Jørgensen
2020-04-28 21:55   ` kbuild test robot
2020-04-28  5:49 ` [PATCH v2 bpf-next 05/10] libbpf: add low-level APIs for new bpf_link commands Andrii Nakryiko
2020-04-28  5:49 ` [PATCH v2 bpf-next 06/10] selftests/bpf: test bpf_link's get_next_id, get_fd_by_id, and get_obj_info Andrii Nakryiko
2020-04-28  5:49 ` [PATCH v2 bpf-next 07/10] bpftool: expose attach_type-to-string array to non-cgroup code Andrii Nakryiko
2020-04-28  8:22   ` Quentin Monnet
2020-04-28  5:49 ` [PATCH v2 bpf-next 08/10] bpftool: add bpf_link show and pin support Andrii Nakryiko
2020-04-28  8:23   ` Quentin Monnet
2020-04-28  5:49 ` [PATCH v2 bpf-next 09/10] bpftool: add bpftool-link manpage Andrii Nakryiko
2020-04-28  8:23   ` Quentin Monnet
2020-04-28  5:49 ` [PATCH v2 bpf-next 10/10] bpftool: add link bash completions Andrii Nakryiko

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