Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbdLIQ23 (ORCPT ); Sat, 9 Dec 2017 11:28:29 -0500 Received: from mail-pl0-f47.google.com ([209.85.160.47]:41972 "EHLO mail-pl0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954AbdLIQ2Z (ORCPT ); Sat, 9 Dec 2017 11:28:25 -0500 X-Google-Smtp-Source: AGs4zMbX+mApsCZ4EyC2ddeAkApbcuqc3p4pMIh/xw+pP37Ia8/KIr+sX7E3Qu4O0ohPbzwpg+PdjQ== Subject: Re: [PATCH v3 net-next 4/4] bpftool: implement cgroup bpf operations To: Jakub Kicinski , Roman Gushchin 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 References: <20171208145236.12635-1-guro@fb.com> <20171208145236.12635-5-guro@fb.com> <20171208154629.20ace049@cakuba.netronome.com> From: David Ahern Message-ID: Date: Sat, 9 Dec 2017 09:28:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171208154629.20ace049@cakuba.netronome.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1229 Lines: 30 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.