From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Vedang Patel <vedang.patel@intel.com>,
netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
vinicius.gomes@intel.com, leandro.maciel.dorileo@intel.com,
m-karicheri2@ti.com, dsahern@gmail.com
Subject: Re: [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags
Date: Mon, 15 Jul 2019 17:34:27 -0700 [thread overview]
Message-ID: <20190715173427.783a0849@cakuba.netronome.com> (raw)
In-Reply-To: <20190715172422.4e127da2@hermes.lan>
On Mon, 15 Jul 2019 17:24:22 -0700, Stephen Hemminger wrote:
> On Mon, 15 Jul 2019 17:15:15 -0700
> Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> > On Mon, 15 Jul 2019 16:37:43 -0700, Stephen Hemminger wrote:
> > > On Mon, 15 Jul 2019 15:51:41 -0700
> > > Vedang Patel <vedang.patel@intel.com> wrote:
> > > > @@ -442,6 +458,11 @@ static int taprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> > > >
> > > > print_string(PRINT_ANY, "clockid", "clockid %s", get_clock_name(clockid));
> > > >
> > > > + if (tb[TCA_TAPRIO_ATTR_FLAGS]) {
> > > > + taprio_flags = rta_getattr_u32(tb[TCA_TAPRIO_ATTR_FLAGS]);
> > > > + print_uint(PRINT_ANY, "flags", " flags %x", taprio_flags);
> > > > + }
> > >[...]
> > > 3. Use the print_0xhex() instead of print_uint() for hex values. The difference
> > > is that in the JSON output, print_uint would be decimal but the print_0xhex
> > > is always hex. And use "flags %#x" so that it is clear you are printing flags in hex.
> >
> > In my humble personal experience scripting tests using iproute2 and
> > bpftool with Python I found printing the "hex string" instead of just
> > outputing the integer value counter productive :( Even tho it looks
> > better to the eye, JSON is primarily for machine processing and hex
> > strings have to be manually converted.
>
> If it is hex on normal output, it should be hex on JSON output.
> And what ever the normal output format is has to be accepted on command line as input.
Ah, I forgot the output == input principle in iproute2!
In any case if there was ever a vote whether to limit this principle to
non-JSON output, and make machines' life easier, I'd vote 'yes' :)
next prev parent reply other threads:[~2019-07-16 0:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 22:51 [PATCH iproute2 net-next v3 1/5] etf: Add skip_sock_check Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 2/5] taprio: Add support for setting flags Vedang Patel
2019-07-15 23:37 ` Stephen Hemminger
2019-07-16 0:15 ` Jakub Kicinski
2019-07-16 0:24 ` Stephen Hemminger
2019-07-16 0:34 ` Jakub Kicinski [this message]
2019-07-16 1:15 ` Patel, Vedang
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 3/5] taprio: add support for setting txtime_delay Vedang Patel
2019-07-15 23:38 ` Stephen Hemminger
2019-07-16 1:17 ` Patel, Vedang
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 4/5] tc: etf: Add documentation for skip-skb-check Vedang Patel
2019-07-15 22:51 ` [PATCH iproute2 net-next v3 5/5] tc: taprio: Update documentation Vedang Patel
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=20190715173427.783a0849@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=leandro.maciel.dorileo@intel.com \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vedang.patel@intel.com \
--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).