diff options
author | Stanislav Fomichev <sdf@google.com> | 2020-05-01 02:31:52 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-05-01 22:44:28 +0300 |
commit | beecf11bc2188067824591612151c4dc6ec383c7 (patch) | |
tree | 69f6fa04eedbf42c247de70bb0df443bacd42c44 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 3dbb5b5040c396274a253b607289748f39a680a0 (diff) | |
download | linux-beecf11bc2188067824591612151c4dc6ec383c7.tar.xz |
bpf: Bpf_{g,s}etsockopt for struct bpf_sock_addr
Currently, bpf_getsockopt and bpf_setsockopt helpers operate on the
'struct bpf_sock_ops' context in BPF_PROG_TYPE_SOCK_OPS program.
Let's generalize them and make them available for 'struct bpf_sock_addr'.
That way, in the future, we can allow those helpers in more places.
As an example, let's expose those 'struct bpf_sock_addr' based helpers to
BPF_CGROUP_INET{4,6}_CONNECT hooks. That way we can override CC before the
connection is made.
v3:
* Expose custom helpers for bpf_sock_addr context instead of doing
generic bpf_sock argument (as suggested by Daniel). Even with
try_socket_lock that doesn't sleep we have a problem where context sk
is already locked and socket lock is non-nestable.
v2:
* s/BPF_PROG_TYPE_CGROUP_SOCKOPT/BPF_PROG_TYPE_SOCK_OPS/
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200430233152.199403-1-sdf@google.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions