From: Roi Dayan <roid@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: Roi Dayan <roid@nvidia.com>, David Ahern <dsahern@gmail.com>,
Hangbin Liu <liuhangbin@gmail.com>,
Paul Blakey <paulb@nvidia.com>,
Davide Caratti <dcaratti@redhat.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Roman Mashak <mrv@mojatatu.com>,
Baowen Zheng <baowen.zheng@corigine.com>,
"Stephen Hemminger" <stephen@networkplumber.org>
Subject: [PATCH iproute2] police: Small corrections for the output
Date: Thu, 8 Jul 2021 10:47:28 +0300 [thread overview]
Message-ID: <20210708074728.3686717-1-roid@nvidia.com> (raw)
Start a newline right before printing the index.
Print overhead with print_size().
Fixes: 0d5cf51e0d6c ("police: Add support for json output")
Signed-off-by: Roi Dayan <roid@nvidia.com>
---
tc/m_police.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tc/m_police.c b/tc/m_police.c
index 2594c08979e0..a17ab64b1ce5 100644
--- a/tc/m_police.c
+++ b/tc/m_police.c
@@ -301,7 +301,8 @@ static int print_police(struct action_util *a, FILE *f, struct rtattr *arg)
RTA_PAYLOAD(tb[TCA_POLICE_RATE64]) >= sizeof(rate64))
rate64 = rta_getattr_u64(tb[TCA_POLICE_RATE64]);
- print_uint(PRINT_ANY, "index", "\t index %u ", p->index);
+ print_nl();
+ print_uint(PRINT_ANY, "index", "\tindex %u ", p->index);
tc_print_rate(PRINT_FP, NULL, "rate %s ", rate64);
buffer = tc_calc_xmitsize(rate64, p->burst);
print_size(PRINT_FP, NULL, "burst %s ", buffer);
@@ -342,7 +343,7 @@ static int print_police(struct action_util *a, FILE *f, struct rtattr *arg)
print_string(PRINT_FP, NULL, " ", NULL);
}
- print_uint(PRINT_ANY, "overhead", "overhead %u ", p->rate.overhead);
+ print_size(PRINT_ANY, "overhead", "overhead %s ", p->rate.overhead);
linklayer = (p->rate.linklayer & TC_LINKLAYER_MASK);
if (linklayer > TC_LINKLAYER_ETHERNET || show_details)
print_string(PRINT_ANY, "linklayer", "linklayer %s ",
--
2.8.0
next reply other threads:[~2021-07-08 7:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 7:47 Roi Dayan [this message]
2021-07-08 7:54 ` [PATCH iproute2] police: Small corrections for the output Roi Dayan
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=20210708074728.3686717-1-roid@nvidia.com \
--to=roid@nvidia.com \
--cc=baowen.zheng@corigine.com \
--cc=dcaratti@redhat.com \
--cc=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=liuhangbin@gmail.com \
--cc=mrv@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=paulb@nvidia.com \
--cc=stephen@networkplumber.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