From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Andrey Ignatov <rdna@fb.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kafai@fb.com,
ast@kernel.org, daniel@iogearbox.net, kernel-team@fb.com
Subject: Re: [PATCH v4 bpf-next 1/6] bpf: Define cgroup_bpf_enabled for CONFIG_CGROUP_BPF=n
Date: Fri, 25 May 2018 09:29:11 -0700 [thread overview]
Message-ID: <20180525162909.rcdopnt56sbif7bt@ast-mbp> (raw)
In-Reply-To: <677e2ddff0a1ff3d19ceb897e68f86e0246526a7.1527263217.git.rdna@fb.com>
On Fri, May 25, 2018 at 08:55:22AM -0700, Andrey Ignatov wrote:
> Static key is used to enable/disable cgroup-bpf related code paths at
> run time.
>
> Though it's not defined when cgroup-bpf is disabled at compile time,
> i.e. CONFIG_CGROUP_BPF=n, and if some code wants to use it, it has to do
> this:
>
> #ifdef CONFIG_CGROUP_BPF
> if (cgroup_bpf_enabled) {
> /* ... some work ... */
> }
> #endif
>
> This code can be simplified by setting cgroup_bpf_enabled to 0 for
> CONFIG_CGROUP_BPF=n case:
>
> if (cgroup_bpf_enabled) {
> /* ... some work ... */
> }
>
> And it aligns well with existing BPF_CGROUP_RUN_PROG_* macros that
> defined for both states of CONFIG_CGROUP_BPF.
>
> Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
next prev parent reply other threads:[~2018-05-25 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 15:55 [PATCH v4 bpf-next 0/6] bpf: Hooks for sys_sendmsg Andrey Ignatov
2018-05-25 15:55 ` [PATCH v4 bpf-next 1/6] bpf: Define cgroup_bpf_enabled for CONFIG_CGROUP_BPF=n Andrey Ignatov
2018-05-25 16:29 ` Alexei Starovoitov [this message]
2018-05-25 15:55 ` [PATCH v4 bpf-next 2/6] bpf: Hooks for sys_sendmsg Andrey Ignatov
2018-05-25 15:55 ` [PATCH v4 bpf-next 3/6] bpf: Sync bpf.h to tools/ Andrey Ignatov
2018-05-25 15:55 ` [PATCH v4 bpf-next 4/6] libbpf: Support guessing sendmsg{4,6} progs Andrey Ignatov
2018-05-25 15:55 ` [PATCH v4 bpf-next 5/6] selftests/bpf: Prepare test_sock_addr for extension Andrey Ignatov
2018-05-25 15:55 ` [PATCH v4 bpf-next 6/6] selftests/bpf: Selftest for sys_sendmsg hooks Andrey Ignatov
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=20180525162909.rcdopnt56sbif7bt@ast-mbp \
--to=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=rdna@fb.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