From: Stanislav Fomichev <sdf@fomichev.me>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Stanislav Fomichev <sdf@google.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
ast@kernel.org, daniel@iogearbox.net
Subject: Re: [PATCH bpf-next v9 0/9] bpf: getsockopt and setsockopt hooks
Date: Thu, 27 Jun 2019 15:43:41 -0700 [thread overview]
Message-ID: <20190627224341.GE4866@mini-arch> (raw)
In-Reply-To: <20190627223147.vkkmbtdcvjzas2ej@ast-mbp.dhcp.thefacebook.com>
On 06/27, Alexei Starovoitov wrote:
> On Thu, Jun 27, 2019 at 01:38:46PM -0700, Stanislav Fomichev wrote:
> > 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)
>
> Applied. Thanks.
Great, thanks for all the reviews!
> There is a build warning though:
> test_sockopt_sk.c: In function ‘getsetsockopt’:
> test_sockopt_sk.c:115:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> if (*(__u32 *)buf != 0x55AA*2) {
> ^~
> test_sockopt_sk.c:116:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> log_err("Unexpected getsockopt(SO_SNDBUF) 0x%x != 0x55AA*2",
> ^~~~~~~
>
> Pls fix it in the follow up.
Sure, but I can't reproduce it with gcc7 nor with clang9 :-/
Presumably, a switch to __get_unaligned_cpu32 should help,
I'll try to play with compilers a bit before sending a fix.
next prev parent reply other threads:[~2019-06-27 22:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 20:38 [PATCH bpf-next v9 0/9] bpf: getsockopt and setsockopt hooks Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 1/9] bpf: implement " Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 2/9] bpf: sync bpf.h to tools/ Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 3/9] libbpf: support sockopt hooks Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 4/9] selftests/bpf: test sockopt section name Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 5/9] selftests/bpf: add sockopt test Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 6/9] selftests/bpf: add sockopt test that exercises sk helpers Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 7/9] selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 8/9] bpf: add sockopt documentation Stanislav Fomichev
2019-06-27 20:38 ` [PATCH bpf-next v9 9/9] bpftool: support cgroup sockopt Stanislav Fomichev
2019-06-27 22:31 ` [PATCH bpf-next v9 0/9] bpf: getsockopt and setsockopt hooks Alexei Starovoitov
2019-06-27 22:43 ` Stanislav Fomichev [this message]
2019-06-27 22:46 ` Alexei Starovoitov
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=20190627224341.GE4866@mini-arch \
--to=sdf@fomichev.me \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
/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).