From: Stanislav Fomichev <sdf@google.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net,
Stanislav Fomichev <sdf@google.com>
Subject: [PATCH bpf-next 0/3] bpf: expose bpf_{s,g}etsockopt helpers to bind{4,6} hooks
Date: Wed, 2 Dec 2020 09:25:13 -0800 [thread overview]
Message-ID: <20201202172516.3483656-1-sdf@google.com> (raw)
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
next reply other threads:[~2020-12-02 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 17:25 Stanislav Fomichev [this message]
2020-12-02 17:25 ` [PATCH bpf-next 1/3] selftests/bpf: rewrite test_sock_addr bind bpf into C Stanislav Fomichev
2020-12-02 17:25 ` [PATCH bpf-next 2/3] bpf: allow bpf_{s,g}etsockopt from cgroup bind{4,6} hooks Stanislav Fomichev
2020-12-02 17:25 ` [PATCH bpf-next 3/3] selftests/bpf: extend bind{4,6} programs with a call to bpf_setsockopt Stanislav Fomichev
2020-12-03 18:32 ` [PATCH bpf-next 0/3] bpf: expose bpf_{s,g}etsockopt helpers to bind{4,6} hooks Alexei Starovoitov
-- strict thread matches above, loose matches on Subject: below --
2020-11-18 0:17 Stanislav Fomichev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201202172516.3483656-1-sdf@google.com \
--to=sdf@google.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).