From: Daniel Borkmann <daniel@iogearbox.net>
To: Takshak Chahande <ctakshak@fb.com>, netdev@vger.kernel.org
Cc: ast@kernel.org, rdna@fb.com, kernel-team@fb.com
Subject: Re: [PATCH bpf-next] bpftool: Add BPF_F_QUERY_EFFECTIVE support in bpftool cgroup [show|tree]
Date: Mon, 24 Jun 2019 16:22:25 +0200 [thread overview]
Message-ID: <6fe292ee-fff0-119c-8524-e25783901167@iogearbox.net> (raw)
In-Reply-To: <20190621223311.1380295-1-ctakshak@fb.com>
On 06/22/2019 12:33 AM, Takshak Chahande wrote:
> With different bpf attach_flags available to attach bpf programs specially
> with BPF_F_ALLOW_OVERRIDE and BPF_F_ALLOW_MULTI, the list of effective
> bpf-programs available to any sub-cgroups really needs to be available for
> easy debugging.
>
> Using BPF_F_QUERY_EFFECTIVE flag, one can get the list of not only attached
> bpf-programs to a cgroup but also the inherited ones from parent cgroup.
>
> So "-e" option is introduced to use BPF_F_QUERY_EFFECTIVE query flag here to
> list all the effective bpf-programs available for execution at a specified
> cgroup.
>
> Reused modified test program test_cgroup_attach from tools/testing/selftests/bpf:
> # ./test_cgroup_attach
>
> With old bpftool (without -e option):
>
> # bpftool cgroup show /sys/fs/cgroup/cgroup-test-work-dir/cg1/
> ID AttachType AttachFlags Name
> 271 egress multi pkt_cntr_1
> 272 egress multi pkt_cntr_2
>
> Attached new program pkt_cntr_4 in cg2 gives following:
>
> # bpftool cgroup show /sys/fs/cgroup/cgroup-test-work-dir/cg1/cg2
> ID AttachType AttachFlags Name
> 273 egress override pkt_cntr_4
>
> And with new "-e" option it shows all effective programs for cg2:
>
> # bpftool -e cgroup show /sys/fs/cgroup/cgroup-test-work-dir/cg1/cg2
> ID AttachType AttachFlags Name
> 273 egress override pkt_cntr_4
> 271 egress override pkt_cntr_1
> 272 egress override pkt_cntr_2
>
> Signed-off-by: Takshak Chahande <ctakshak@fb.com>
> Acked-by: Andrey Ignatov <rdna@fb.com>
Applied, thanks!
next prev parent reply other threads:[~2019-06-24 14:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 22:33 [PATCH bpf-next] bpftool: Add BPF_F_QUERY_EFFECTIVE support in bpftool cgroup [show|tree] Takshak Chahande
2019-06-24 14:22 ` Daniel Borkmann [this message]
2019-06-24 21:51 ` Jakub Kicinski
2019-06-24 22:16 ` Andrey Ignatov
2019-06-24 22:43 ` Jakub Kicinski
2019-06-24 23:38 ` Alexei Starovoitov
2019-06-25 0:16 ` Jakub Kicinski
2019-06-25 0:21 ` Alexei Starovoitov
2019-06-25 0:30 ` Jakub Kicinski
2019-06-25 0:40 ` Alexei Starovoitov
2019-06-25 0:47 ` Jakub Kicinski
2019-06-25 0:57 ` Jakub Kicinski
2019-06-25 1:23 ` Alexei Starovoitov
2019-06-25 1:39 ` Takshak Chahande
2019-06-25 1:22 ` 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=6fe292ee-fff0-119c-8524-e25783901167@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ast@kernel.org \
--cc=ctakshak@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;
as well as URLs for NNTP newsgroup(s).