linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>,
	Roman Gushchin <guro@fb.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com, ast@kernel.org, daniel@iogearbox.net,
	kafai@fb.com, Quentin Monnet <quentin.monnet@netronome.com>
Subject: Re: [PATCH v3 net-next 4/4] bpftool: implement cgroup bpf operations
Date: Sat, 9 Dec 2017 09:28:17 -0700	[thread overview]
Message-ID: <f7cf4c91-7ba6-5771-7a1d-70bed1213dd9@gmail.com> (raw)
In-Reply-To: <20171208154629.20ace049@cakuba.netronome.com>

On 12/8/17 4:46 PM, Jakub Kicinski wrote:
>> +	argc -= 2;
>> +	argv = &argv[2];
>> +	prog_fd = prog_parse_fd(&argc, &argv);
>> +	if (prog_fd < 0)
>> +		goto exit_cgroup;
>> +
>> +	for (i = 0; i < argc; i++) {
>> +		if (strcmp(argv[i], "allow_multi") == 0) {
>> +			attach_flags |= BPF_F_ALLOW_MULTI;
>> +		} else if (strcmp(argv[i], "allow_override") == 0) {
>> +			attach_flags |= BPF_F_ALLOW_OVERRIDE;
> 
> I don't feel about this strongly but as I said I was trying to follow
> iproute2's conventions, and it allows aliasing.  So if you type "ip a"
> it will give you the first thing that starts with a, not necessarily
> alphabetically, more likely in order of usefulness or order in which
> things were added.  IOW if "allow_" selects "allow_mutli" that's what I
> would actually expect it to do..
> 
> Maybe others disagree?

The iproute2 syntax is very user friendly, and I agree with following
the conventions.

With respect to the attach flags, allow_yyyyy is a lot to type, but
having 'a .. allow_' mean one flag over the other is going to be
confusing. Perhaps dropping the 'allow_' prefix in favor of just 'multi'
and 'override' and doing prefix match on it? User commands do not need
to follow flag names precisely.

      reply	other threads:[~2017-12-09 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 14:52 [PATCH v3 net-next 0/4] bpftool: cgroup bpf operations Roman Gushchin
2017-12-08 14:52 ` [PATCH v3 net-next 1/4] libbpf: add ability to guess program type based on section name Roman Gushchin
2017-12-08 14:52 ` [PATCH v3 net-next 2/4] libbpf: prefer global symbols as bpf program name source Roman Gushchin
2017-12-08 14:52 ` [PATCH v3 net-next 3/4] bpftool: implement prog load command Roman Gushchin
2017-12-08 14:52 ` [PATCH v3 net-next 4/4] bpftool: implement cgroup bpf operations Roman Gushchin
2017-12-08 23:46   ` Jakub Kicinski
2017-12-09 16:28     ` David Ahern [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=f7cf4c91-7ba6-5771-7a1d-70bed1213dd9@gmail.com \
    --to=dsahern@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=guro@fb.com \
    --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 \
    --cc=quentin.monnet@netronome.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).