[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAA93jw6SSZY_txKMrii3FypWKcCtd3LoUniGAVpkoQmwkyht0Q@mail.gmail.com>
Date: Wed, 3 Oct 2018 09:09:21 -0700
From: Dave Taht <dave.taht@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Yousuk Seung <ysseung@...gle.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Michael McLennan <nefario@...gle.com>,
Priyaranjan Jha <priyarjha@...gle.com>,
Neal Cardwell <ncardwell@...gle.com>
Subject: Re: [PATCH v2 iproute2-next 1/3] tc: support conversions to or from
64 bit nanosecond-based time
On Mon, Aug 27, 2018 at 9:39 AM Dave Taht <dave.taht@...il.com> wrote:
>
> On Mon, Aug 27, 2018 at 9:11 AM Stephen Hemminger
> <stephen@...workplumber.org> wrote:
> >
> > On Sun, 26 Aug 2018 19:42:28 -0700
> > Yousuk Seung <ysseung@...gle.com> wrote:
> >
> > > +int get_time(unsigned int *time, const char *str)
> > > +{
> > > + double t;
> > > + char *p;
> > > +
> > > + t = strtod(str, &p);
> > > + if (p == str)
> > > + return -1;
> > > +
> > > + if (*p) {
> > > + if (strcasecmp(p, "s") == 0 || strcasecmp(p, "sec") == 0 ||
> > > + strcasecmp(p, "secs") == 0)
> > > + t *= TIME_UNITS_PER_SEC;
> > > + else if (strcasecmp(p, "ms") == 0 || strcasecmp(p, "msec") == 0 ||
> > > + strcasecmp(p, "msecs") == 0)
> > > + t *= TIME_UNITS_PER_SEC/1000;
> > > + else if (strcasecmp(p, "us") == 0 || strcasecmp(p, "usec") == 0 ||
> > > + strcasecmp(p, "usecs") == 0)
> > > + t *= 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 (δ) and beta (β) in particular. It would
> 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äht
> CEO, TekLibre, LLC
> http://www.teklibre.com
> Tel: 1-669-226-2619
--
Dave Täht
CEO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-669-226-2619
Powered by blists - more mailing lists