]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'bpf-bpftool-cgroup-ops'
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 14 Dec 2017 12:37:14 +0000 (13:37 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 14 Dec 2017 12:37:14 +0000 (13:37 +0100)
commit6cdad89a6e56ce50fd35272cfbf80079166a5317
tree3efa08b5e65d54e15de2ca811f85f430148b7a39
parent0a9fb0e471c4681432e3075dc2400a207454ee2e
parent4aa674f100820d954357c1fe50bc0c712b22c313
Merge branch 'bpf-bpftool-cgroup-ops'

Roman Gushchin says:

====================
This patchset adds basic cgroup bpf operations to bpftool.

Right now there is no convenient way to perform these operations.
The /samples/bpf/load_sock_ops.c implements attach/detacg operations,
but only for BPF_CGROUP_SOCK_OPS programs. Bps (part of bcc) implements
bpf introspection, but lacks any cgroup-related specific.

I find having a tool to perform these basic operations in the kernel tree
very useful, as it can be used in the corresponding bpf documentation
without creating additional dependencies. And bpftool seems to be
a right tool to extend with such functionality.

v4:
  - ATTACH_FLAGS and ATTACH_TYPE are listed and described in docs and usage
  - ATTACH_FLAG names converted to "multi" and "override"
  - do_attach() recognizes ATTACH_FLAG abbreviations, e.g "mul"
  - Local variables sorted ("reverse Christmas tree")
  - unknown attach flags value will be never truncated

v3:
  - SRC replaced with OBJ in prog load docs
  - Output unknown attach type in hex
  - License header in SPDX format
  - Minor style fixes (e.g. variable reordering)

v2:
  - Added prog load operations
  - All cgroup operations are looking like bpftool cgroup <command>
  - All cgroup-related stuff is moved to a separate file
  - Added support for attach flags
  - Added support for attaching/detaching programs by id, pinned name, etc
  - Changed cgroup detach arguments order
  - Added empty json output for succesful programs
  - Style fixed: includes order, strncmp and macroses, error handling
  - Added man pages

v1:
  https://lwn.net/Articles/740366/
====================

Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>