From: sdf@google•com
To: kafai@fb•com, netdev@vger•kernel.org, bpf@vger•kernel.org,
davem@davemloft•net, ast@kernel•org, daniel@iogearbox•net
Subject:
Date: Wed, 29 Apr 2020 16:53:40 +0000 [thread overview]
Message-ID: <0000000000004c3fe305a470ca38@google.com> (raw)
Date: Wed, 29 Apr 2020 09:53:39 -0700
From: Stanislav Fomichev <sdf@google•com>
To: Martin KaFai Lau <kafai@fb•com>
Cc: netdev@vger•kernel.org, bpf@vger•kernel.org, davem@davemloft•net,
ast@kernel•org, daniel@iogearbox•net
Subject: Re: [PATCH bpf-next] bpf: bpf_{g,s}etsockopt for struct bpf_sock
Message-ID: <20200429165339.GA40941@google•com>
References: <20200428185719.46815-1-sdf@google•com>
<20200429164550.xmlklvypzlcjagvw@kafai-mbp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20200429164550.xmlklvypzlcjagvw@kafai-mbp>
On 04/29, Martin KaFai Lau wrote:
> On Tue, Apr 28, 2020 at 11:57:19AM -0700, Stanislav Fomichev wrote:
> > Currently, bpf_getsocktop and bpf_setsockopt helpers operate on the
> > 'struct bpf_sock_ops' context in BPF_PROG_TYPE_CGROUP_SOCKOPT program.
> > Let's generalize them and make the first argument be 'struct bpf_sock'.
> > That way, in the future, we can allow those helpers in more places.
> s/BPF_PROG_TYPE_CGROUP_SOCKOPT/BPF_PROG_TYPE_SOCK_OPS/
> Same for the other uses in the commit message and also
> the document comment in the uapi (and tools) bpf.h.
> Others LGTM.
Oops, good catch, will follow up with a v2, thanks!
> > BPF_PROG_TYPE_CGROUP_SOCKOPT still has the existing helpers that operate
> > on 'struct bpf_sock_ops', but we add new bpf_{g,s}etsockopt that work
> > on 'struct bpf_sock'. [Alternatively, for BPF_PROG_TYPE_CGROUP_SOCKOPT,
> > we can enable them both and teach verifier to pick the right one
> > based on the context (bpf_sock_ops vs bpf_sock).]
> >
> > As an example, let's allow those 'struct bpf_sock' based helpers to
> > be called from the BPF_CGROUP_INET{4,6}_CONNECT hooks. That way
> > we can override CC before the connection is made.
> >
> > Signed-off-by: Stanislav Fomichev <sdf@google•com>
reply other threads:[~2020-04-29 16:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=0000000000004c3fe305a470ca38@google.com \
--to=sdf@google$(echo .)com \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=kafai@fb$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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