[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201202172516.3483656-1-sdf@google.com>
Date: Wed, 2 Dec 2020 09:25:13 -0800
From: Stanislav Fomichev <sdf@...gle.com>
To: netdev@...r.kernel.org, bpf@...r.kernel.org
Cc: davem@...emloft.net, ast@...nel.org, daniel@...earbox.net,
Stanislav Fomichev <sdf@...gle.com>
Subject: [PATCH bpf-next 0/3] bpf: expose bpf_{s,g}etsockopt helpers to
bind{4,6} hooks
This might be useful for the listener sockets to pre-populate
some options. Since those helpers require locked sockets,
I'm changing bind hooks to lock/unlock the sockets. This
should not cause any performance overhead because at this
point there shouldn't be any socket lock contention and the
locking/unlocking should be cheap.
Also, as part of the series, I convert test_sock_addr bpf
assembly into C (and preserve the narrow load tests) to
make it easier to extend with th bpf_setsockopt later on.
v2:
* remove version from bpf programs (Andrii Nakryiko)
Stanislav Fomichev (3):
selftests/bpf: rewrite test_sock_addr bind bpf into C
bpf: allow bpf_{s,g}etsockopt from cgroup bind{4,6} hooks
selftests/bpf: extend bind{4,6} programs with a call to bpf_setsockopt
include/linux/bpf-cgroup.h | 12 +-
net/core/filter.c | 4 +
net/ipv4/af_inet.c | 2 +-
net/ipv6/af_inet6.c | 2 +-
.../testing/selftests/bpf/progs/bind4_prog.c | 102 +++++++++
.../testing/selftests/bpf/progs/bind6_prog.c | 119 +++++++++++
tools/testing/selftests/bpf/test_sock_addr.c | 196 ++----------------
7 files changed, 245 insertions(+), 192 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/bind4_prog.c
create mode 100644 tools/testing/selftests/bpf/progs/bind6_prog.c
--
2.29.2.454.gaff20da3a2-goog
Powered by blists - more mailing lists