From: David Ahern <dsahern@gmail.com>
To: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>,
netdev@vger.kernel.org
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
Vinicius Costa Gomes <vinicius.gomes@intel.com>
Subject: Re: [PATCH v3 iproute2 2/3] tc: Add support for the ETF Qdisc
Date: Mon, 9 Jul 2018 11:32:35 -0600 [thread overview]
Message-ID: <a3036b8e-3e89-2fde-b484-6e326b113adb@gmail.com> (raw)
In-Reply-To: <a009803c-1036-eae9-c57d-2b95eecd551d@intel.com>
On 7/9/18 9:48 AM, Jesus Sanchez-Palencia wrote:
> Hi David,
>
>
> On 07/06/2018 08:58 AM, David Ahern wrote:
>> On 7/5/18 4:42 PM, Jesus Sanchez-Palencia wrote:
>>
>>> +static int get_clockid(__s32 *val, const char *arg)
>>> +{
>>> + const struct static_clockid {
>>> + const char *name;
>>> + clockid_t clockid;
>>> + } clockids_sysv[] = {
>>> + { "CLOCK_REALTIME", CLOCK_REALTIME },
>>> + { "CLOCK_TAI", CLOCK_TAI },
>>> + { "CLOCK_BOOTTIME", CLOCK_BOOTTIME },
>>> + { "CLOCK_MONOTONIC", CLOCK_MONOTONIC },
>>> + { NULL }
>>> + };
>>> +
>>> + const struct static_clockid *c;
>>> +
>>> + for (c = clockids_sysv; c->name; c++) {
>>> + if (strncasecmp(c->name, arg, 25) == 0) {
>>
>> Why 25?
>
>
> That was just an upper bound giving some room beyond the longest
> clockid name we have today. Should I add a define MAX_CLOCK_NAME ?
why not just strcasecmp? using the 'n' variant with n > strlen of either
argument seems pointless.
>
>
>>
>> be nice to allow shortcuts -- e.g., just REALTIME or realtime.
>
>
> I'd rather just keep it as is and use the names as they are defined for
> everything else (i.e. CLOCK_REALTIME), unless there are some strong objections.
An all caps argument is unnecessary work on the pinky finger and the
CLOCK_ prefix is redundant to the keyword. Really, just a thought on
making it easier for users. A CLI argument does not need to maintain a
1:1 with code names.
next prev parent reply other threads:[~2018-07-09 17:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 22:42 [PATCH v3 iproute2 0/3] Add support for ETF qdisc Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 1/3] uapi pkt_sched: Add etf info - DO NOT COMMIT Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 2/3] tc: Add support for the ETF Qdisc Jesus Sanchez-Palencia
2018-07-06 15:58 ` David Ahern
2018-07-09 15:48 ` Jesus Sanchez-Palencia
2018-07-09 17:32 ` David Ahern [this message]
2018-07-09 23:16 ` Jesus Sanchez-Palencia
2018-07-06 21:32 ` Stephen Hemminger
2018-07-06 21:54 ` Jesus Sanchez-Palencia
2018-07-05 22:42 ` [PATCH v3 iproute2 3/3] man: Add initial manpage for tc-etf(8) Jesus Sanchez-Palencia
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=a3036b8e-3e89-2fde-b484-6e326b113adb@gmail.com \
--to=dsahern@gmail.com \
--cc=jesus.sanchez-palencia@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=vinicius.gomes@intel.com \
--cc=xiyou.wangcong@gmail.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).