From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v3 net-next 4/4] bpftool: implement cgroup bpf operations Date: Sat, 9 Dec 2017 09:28:17 -0700 Message-ID: References: <20171208145236.12635-1-guro@fb.com> <20171208145236.12635-5-guro@fb.com> <20171208154629.20ace049@cakuba.netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 To: Jakub Kicinski , Roman Gushchin Return-path: In-Reply-To: <20171208154629.20ace049@cakuba.netronome.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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.