From: Roman Gushchin <guro@fb.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-team@fb.com>, <ast@kernel.org>, <daniel@iogearbox.net>,
<kafai@fb.com>
Subject: Re: [PATCH net-next 0/5] bpftool: cgroup bpf operations
Date: Fri, 1 Dec 2017 17:06:25 +0000 [thread overview]
Message-ID: <20171201170624.GC27436@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20171130190454.26723962@cakuba.netronome.com>
On Thu, Nov 30, 2017 at 07:04:54PM -0800, Jakub Kicinski wrote:
> Hi Roman!
>
> On Thu, 30 Nov 2017 13:42:57 +0000, Roman Gushchin wrote:
> > This patchset adds basic cgroup bpf operations to bpftool.
> >
> > Right now there is no convenient way to perform these operations.
> > The /samples/bpf/load_sock_ops.c implements attach/detacg operations,
> > but only for BPF_CGROUP_SOCK_OPS programs. Bps (part of bcc) implements
> > bpf introspection, but lacks any cgroup-related specific.
> >
> > I find having a tool to perform these basic operations in the kernel tree
> > very useful, as it can be used in the corresponding bpf documentation
> > without creating additional dependencies. And bpftool seems to be
> > a right tool to extend with such functionality.
>
> Could you place your code in a new file and add a new "object level"?
> I.e.
> bpftool cgroup list
> bpftool cgroup attach ...
> bpftool cgroup help
> etc? Note that you probably want the list to be first, so if someone
> types "bpftool cg" it runs list by default.
>
> Does it make sense to support pinned files and specifying programs by
> id? I used the "id"/"pinned" keywords so that users can choose to use
> either. Perhaps you should at least prefix the file to with "file"?
> So:
> $ bpftool cgattach file ./mybpfprog.o /sys/fs/cgroup/user.slice/ ingress
> $ bpftool cgattach id 19 /sys/fs/cgroup/user.slice/ ingress
> $ bpftool cgattach pin /bpf/prog /sys/fs/cgroup/user.slice/ ingress
> Would this make sense?
>
> Smaller nits on the coding style:
> - please try to run checkpatch, perhaps you did, but some people
> forget tools are in the kernel tree :)
> - please keep includes in alphabetical order;
> - please keep variable declarations in functions ordered longest to
> shortest, if that's impossible because of dependency between
> initializers - move the initializers to the code.
>
> Please also don't forget to update/create new man page.
Ok, I'll try to address these comments in v2.
Thank you!
prev parent reply other threads:[~2017-12-01 17:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 13:42 [PATCH net-next 0/5] bpftool: cgroup bpf operations Roman Gushchin
2017-11-30 13:42 ` [PATCH net-next 1/5] libbpf: add ability to guess program type based on section name Roman Gushchin
2017-12-01 10:22 ` Quentin Monnet
2017-12-01 22:46 ` Jakub Kicinski
2017-12-04 12:34 ` Roman Gushchin
2017-12-04 13:12 ` Quentin Monnet
2017-12-04 13:22 ` Roman Gushchin
2017-11-30 13:42 ` [PATCH net-next 2/5] libbpf: prefer global symbols as bpf program name source Roman Gushchin
2017-11-30 13:43 ` [PATCH net-next 3/5] bpftool: implement cgattach command Roman Gushchin
2017-11-30 16:17 ` David Ahern
2017-11-30 16:44 ` Roman Gushchin
2017-11-30 16:24 ` David Ahern
2017-12-01 3:13 ` Jakub Kicinski
2017-11-30 13:43 ` [PATCH net-next 4/5] bpftool: implement cgdetach command Roman Gushchin
2017-12-01 10:26 ` Quentin Monnet
2017-11-30 13:43 ` [PATCH net-next 5/5] bpftool: implement cglist command Roman Gushchin
2017-12-01 3:04 ` [PATCH net-next 0/5] bpftool: cgroup bpf operations Jakub Kicinski
2017-12-01 17:06 ` Roman Gushchin [this message]
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=20171201170624.GC27436@castle.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=jakub.kicinski@netronome.com \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--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).