From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Taht Subject: Re: [PATCH v2 iproute2-next 1/3] tc: support conversions to or from 64 bit nanosecond-based time Date: Wed, 3 Oct 2018 09:09:21 -0700 Message-ID: References: <20180827024230.246445-1-ysseung@google.com> <20180827024230.246445-2-ysseung@google.com> <20180827091156.46691f4f@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Yousuk Seung , Linux Kernel Network Developers , David Ahern , Michael McLennan , Priyaranjan Jha , Neal Cardwell To: Stephen Hemminger Return-path: Received: from mail-qt1-f196.google.com ([209.85.160.196]:46188 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726833AbeJCW6f (ORCPT ); Wed, 3 Oct 2018 18:58:35 -0400 Received: by mail-qt1-f196.google.com with SMTP id d8-v6so6487329qtk.13 for ; Wed, 03 Oct 2018 09:09:33 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Mon, Aug 27, 2018 at 9:39 AM Dave Taht wrote: > > On Mon, Aug 27, 2018 at 9:11 AM Stephen Hemminger > wrote: > > > > On Sun, 26 Aug 2018 19:42:28 -0700 > > Yousuk Seung wrote: > > > > > +int get_time(unsigned int *time, const char *str) > > > +{ > > > + double t; > > > + char *p; > > > + > > > + t =3D strtod(str, &p); > > > + if (p =3D=3D str) > > > + return -1; > > > + > > > + if (*p) { > > > + if (strcasecmp(p, "s") =3D=3D 0 || strcasecmp(p, "sec")= =3D=3D 0 || > > > + strcasecmp(p, "secs") =3D=3D 0) > > > + t *=3D TIME_UNITS_PER_SEC; > > > + else if (strcasecmp(p, "ms") =3D=3D 0 || strcasecmp(p, = "msec") =3D=3D 0 || > > > + strcasecmp(p, "msecs") =3D=3D 0) > > > + t *=3D TIME_UNITS_PER_SEC/1000; > > > + else if (strcasecmp(p, "us") =3D=3D 0 || strcasecmp(p, = "usec") =3D=3D 0 || > > > + strcasecmp(p, "usecs") =3D=3D 0) > > > + t *=3D TIME_UNITS_PER_SEC/1000000; > > > + else > > > + return -1; > > > > Do we need to really support UPPER case. > > But that's ALWAYS been the case in the 32 bit version of code above. > Imagine how many former VMS and MVS hackers you'd upset if they had to > turn caps-lock off! I was trying to be funny, of course. If you want us to rework the patch to also downgrade to being lowercase for both, ok... I'd rather like to finish getting this upstream, there's a change to netem enabling nsec time long stuck behind it. > > > Isn't existing matches semantics good enough? > > But that's the existing case for the 32 bit api, now replicated in the > 64 bit api. ? I think the case-insensitive ship has sailed here. Can't > break userspace. > > Well.. adding UTF-8 would be cool. We could start using the actual > greek symbols for delta (=CE=B4) and beta (=CE=B2) in particular. It wou= ld > replace a lot of typing, with a whole bunch more shift keys on a > single letter, fit better into > 80 column lines, and so on, and tc inputs and outputs are already > pretty greek to many. > -- > > Dave T=C3=A4ht > CEO, TekLibre, LLC > http://www.teklibre.com > Tel: 1-669-226-2619 --=20 Dave T=C3=A4ht CEO, TekLibre, LLC http://www.teklibre.com Tel: 1-669-226-2619