bpf: getsockopt and setsockopt hooks
Status from this message: Applied. Thanks.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v9 Latest9 patches 3 repliesApplied
- v89 patches 4 repliesSuperseded
- v79 patches 4 repliesSuperseded
Earlier versions · 6
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v6 | 9 patches | 5 replies | Superseded | |
| v5 | 8 patches | 6 replies | Superseded | |
| v4 | 8 patches | 5 replies | Superseded | |
| v3 | 8 patches | 2 replies | Superseded | |
| v2 | 8 patches | 6 replies | Superseded | |
| v1 | 7 patches | 10 replies | Superseded |
Changes in v9 from the cover letter
* allow overwriting setsocktop arguments (Alexei Starovoitov) (see individual changes for more changelog details)
Patches in v9 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | bpf: implement getsockopt and setsockopt hooksinclude/ include/ include/ +8 more | +472 | 0 replies | |
| 2/9 | bpf: sync bpf.h to tools/tools/ | +14 | 0 replies | |
| 3/9 | libbpf: support sockopt hookstools/ tools/ | +6 | 0 replies | |
| 4/9 | selftests/bpf: test sockopt section nametools/ | +10 | 0 replies | |
| 5/9 | selftests/bpf: add sockopt testtools/ tools/ tools/ | +1024 | 0 replies | |
| 6/9 | selftests/bpf: add sockopt test that exercises sk helperstools/ tools/ tools/ +1 more | +328 | 0 replies | |
| 7/9 | selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTItools/ tools/ tools/ +1 more | +449 | 0 replies | |
| 8/9 | bpf: add sockopt documentationDocumentation/ Documentation/ | +94 | 0 replies | |
| 9/9 | bpftool: support cgroup sockopttools/ tools/ tools/ +3 more | +20 | 0 replies |
Reviews trailers per patch
1 of 9 patches has a Reviewed-by or Acked-by.
| Patch | Jakub Kicinski |
|---|---|
| 1/9 | |
| 2/9 | |
| 3/9 | |
| 4/9 | |
| 5/9 | |
| 6/9 | |
| 7/9 | |
| 8/9 | |
| 9/9 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v9 0/9] bpf: getsockopt and setsockopt hooks
This series implements two new per-cgroup hooks: getsockopt and setsockopt along with a new sockopt program type. The idea is pretty similar to recently introduced cgroup sysctl hooks, but implementation is simpler (no need to convert to/from strings).
What this can be applied to:
* move business logic of what tos/priority/etc can be set by containers (either pass or reject)
* handle existing options (or introduce new ones) differently by propagating some information in cgroup/socket local storage
Compared to a simple syscall/{g,s}etsockopt tracepoint, those hooks are context aware. Meaning, they can access underlying socket and use cgroup and socket local storage.
v9:
* allow overwriting setsocktop arguments (Alexei Starovoitov) (see individual changes for more changelog details)
Stanislav Fomichev (9):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name selftests/bpf: add sockopt test
selftests/bpf: add sockopt test that exercises sk helpers selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI
bpf: add sockopt documentation
bpftool: support cgroup sockopt
Documentation/bpf/index.rst | 1 + Documentation/bpf/prog_cgroup_sockopt.rst | 93 ++ include/linux/bpf-cgroup.h | 45 + include/linux/bpf.h | 2 + include/linux/bpf_types.h | 1 + include/linux/filter.h | 10 + include/uapi/linux/bpf.h | 14 + kernel/bpf/cgroup.c | 333 ++++++ kernel/bpf/core.c | 9 + kernel/bpf/syscall.c | 19 + kernel/bpf/verifier.c | 8 + net/core/filter.c | 2 +- net/socket.c | 30 + .../bpftool/Documentation/bpftool-cgroup.rst | 7 +- .../bpftool/Documentation/bpftool-prog.rst | 3 +- tools/bpf/bpftool/bash-completion/bpftool | 9 +- tools/bpf/bpftool/cgroup.c | 5 +- tools/bpf/bpftool/main.h | 1 + tools/bpf/bpftool/prog.c | 3 +- tools/include/uapi/linux/bpf.h | 14 + tools/lib/bpf/libbpf.c | 5 + tools/lib/bpf/libbpf_probes.c | 1 + tools/testing/selftests/bpf/.gitignore | 3 + tools/testing/selftests/bpf/Makefile | 6 +- .../selftests/bpf/progs/sockopt_multi.c | 71 ++ .../testing/selftests/bpf/progs/sockopt_sk.c | 111 ++ .../selftests/bpf/test_section_names.c | 10 + tools/testing/selftests/bpf/test_sockopt.c | 1021 +++++++++++++++++ .../selftests/bpf/test_sockopt_multi.c | 374 ++++++ tools/testing/selftests/bpf/test_sockopt_sk.c | 214 ++++ 30 files changed, 2415 insertions(+), 10 deletions(-) create mode 100644 Documentation/bpf/prog_cgroup_sockopt.rst create mode 100644 tools/testing/selftests/bpf/progs/sockopt_multi.c create mode 100644 tools/testing/selftests/bpf/progs/sockopt_sk.c create mode 100644 tools/testing/selftests/bpf/test_sockopt.c create mode 100644 tools/testing/selftests/bpf/test_sockopt_multi.c create mode 100644 tools/testing/selftests/bpf/test_sockopt_sk.c
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog