From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Cc: cake@lists.bufferbloat.net, Dave Taht <dave.taht@gmail.com>
Subject: Re: [Cake] [PATCH iproute2-next v10] Add support for CAKE qdisc
Date: Thu, 19 Jul 2018 12:53:44 +0200 [thread overview]
Message-ID: <87bmb34htz.fsf@toke.dk> (raw)
In-Reply-To: <ecadada4-3a27-f11c-dc8d-00998cf1d097@gmail.com>
A few comments below; will fix the rest.
>> + print_uint(PRINT_JSON, "bandwidth", NULL, bandwidth);
>> + print_string(PRINT_FP, NULL, "bandwidth %s ", sprint_rate(bandwidth, b1));
>> + } else
>> + print_string(PRINT_ANY, "bandwidth", "bandwidth %s ", "unlimited");
>> + }
>> + if (tb[TCA_CAKE_AUTORATE] &&
>> + RTA_PAYLOAD(tb[TCA_CAKE_AUTORATE]) >= sizeof(__u32)) {
>> + autorate = rta_getattr_u32(tb[TCA_CAKE_AUTORATE]);
>> + if(autorate == 1)
>> + print_string(PRINT_ANY, "autorate", "autorate_%s ", "ingress");
>> + else if(autorate)
>> + print_string(PRINT_ANY, "autorate", "(?autorate?) ", "unknown");
>
> Why the '(?' and '?)'? here and the diffserv below.
The (? ?) indicates that a value was present, but it was not understood
by tc. This has been quite useful to discover mismatch between kernel
and userspace versions of CAKE as we have been developing it.
>> + }
>> +
>> + if (tb[TCA_CAKE_NAT] &&
>> + RTA_PAYLOAD(tb[TCA_CAKE_NAT]) >= sizeof(__u32)) {
>> + nat = rta_getattr_u32(tb[TCA_CAKE_NAT]);
>> + }
>> +
>> + if(nat)
>> + print_string(PRINT_FP, NULL, "nat ", NULL);
>> + print_bool(PRINT_JSON, "nat", NULL, nat);
>
> why is the fp print under the if check but the json one is not? you
> have this in a number of places. Why not be consistent in the output?
Because JSON can actually express booleans properly, and thus we can be
explicit about its value instead of just omitting it.
-Toke
next prev parent reply other threads:[~2018-07-19 10:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 16:39 Toke Høiland-Jørgensen
2018-07-16 17:06 ` Stephen Hemminger
2018-07-16 17:56 ` Toke Høiland-Jørgensen
2018-07-16 17:58 ` Stephen Hemminger
2018-07-18 2:31 ` David Ahern
2018-07-19 10:53 ` Toke Høiland-Jørgensen [this message]
2018-07-19 14:55 ` David Ahern
2018-07-19 15:20 ` Toke Høiland-Jørgensen
2018-07-19 15:22 ` David Ahern
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
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmb34htz.fsf@toke.dk \
--to=toke@toke.dk \
--cc=cake@lists.bufferbloat.net \
--cc=dave.taht@gmail.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
/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