From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [PATCH iproute2] tc: fix second printing of requeues Date: Sat, 27 Jan 2018 01:19:04 -0800 Message-ID: <20180127091904.6772-1-jakub.kicinski@netronome.com> Cc: dsahern@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org, oss-drivers@netronome.com, Jakub Kicinski To: stephen@networkplumber.org Return-path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:37889 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbeA0JTW (ORCPT ); Sat, 27 Jan 2018 04:19:22 -0500 Received: by mail-pg0-f65.google.com with SMTP id y27so1585991pgc.5 for ; Sat, 27 Jan 2018 01:19:22 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: Non-JSON tc qdisc output used to print the "requeues" statistic twice. Commit 4fcec7f3665b ("tc: jsonify stats2") tried to preserve this behaviour for both standard output and JSON, but used the wrong statistic (q.qlen). Also duplicating keys in JSON is not allowed, so the second occurrence should be completely skipped with JSON. Fixes: 4fcec7f3665b ("tc: jsonify stats2") Signed-off-by: Jakub Kicinski --- tc/tc_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index 10e5aa91168a..aceb0d944933 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -846,7 +846,7 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat print_string(PRINT_FP, NULL, "backlog %s", sprint_size(q.backlog, b1)); print_uint(PRINT_ANY, "qlen", " %up", q.qlen); - print_uint(PRINT_ANY, "requeues", " requeues %u", q.qlen); + print_uint(PRINT_FP, NULL, " requeues %u", q.requeues); } if (xstats) -- 2.15.1