From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2-next 0/9] TC more JSON support Date: Fri, 13 Jul 2018 15:22:11 -0700 Message-ID: <20180713152211.4072bf28@xeon-e3> References: <20180709194856.18922-1-stephen@networkplumber.org> <9ad5c235-8c66-4a62-0517-af4ae6bdddac@gmail.com> <20180713142942.49d24264@cakuba.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: David Ahern , netdev@vger.kernel.org, Stephen Hemminger , Jiri Pirko , Cong Wang , Jamal Hadi Salim To: Jakub Kicinski Return-path: Received: from mail-pl0-f68.google.com ([209.85.160.68]:44164 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbeGMWis (ORCPT ); Fri, 13 Jul 2018 18:38:48 -0400 Received: by mail-pl0-f68.google.com with SMTP id m16-v6so12757818pls.11 for ; Fri, 13 Jul 2018 15:22:14 -0700 (PDT) In-Reply-To: <20180713142942.49d24264@cakuba.lan> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 13 Jul 2018 14:29:42 -0700 Jakub Kicinski wrote: > On Fri, 13 Jul 2018 16:48:28 -0400, David Ahern wrote: > > On 7/9/18 3:48 PM, Stephen Hemminger wrote: > > > From: Stephen Hemminger > > > > > > Update core of TC command and library to do more JSON. > > > Most of this patch set is about getting tc utility functions > > > to be more friendly to the json_print infrastructure. > > > > > > Stephen Hemminger (9): > > > tc: use JSON in error handling > > > tc: use const char in util > > > tc: convert stats print to json > > > tc/cbq: use sprint_rate > > > tc/util: remove print_rate > > > tc/util: remove unused print_size > > > tc/util: remove unused print_time > > > tc/util: add print helpers for JSON > > > tc/sfq: add json support > > > > > > tc/q_cbq.c | 15 ++++----- > > > tc/q_sfq.c | 65 +++++++++++++++++++++--------------- > > > tc/tc.c | 19 ++++++----- > > > tc/tc_util.c | 94 +++++++++++++++++++++++++++------------------------- > > > tc/tc_util.h | 11 +++--- > > > 5 files changed, 109 insertions(+), 95 deletions(-) > > > > > > > I'd prefer some tc folks to take a look at the json output and verify > > everything is good. > > > > Jamal, Jiri, Jakub, Cong, others? > > > > There is a second set with 30 patches as well. > > AFAIK the 31 patches supersede this set? I only have tests that use > JSON for MQ and RED qdiscs, and those work fine with the v2 applied! This is what I used to test the trivial ones. Some require more parameters. #! /bin/sh for q in cbq cbs choke clsact codel drr dsmark fifo \ fq fq_codel gred hfsc hhf htb ingress mqprio \ multiq netem pie prio qfq red rr sfb sfq tbf do echo -n $q ": " sudo tc qdisc add dev dummy0 root $q 2>/dev/null if [ $? -ne 0 ]; then echo "can not test" else /sbin/tc qdisc show dev dummy0 >$q.orig ./tc/tc qdisc show dev dummy0 >$q.new if cmp $q.new $q.orig; then echo -n "ok" else echo -n "differ" fi ./tc/tc -j qdisc show dev dummy0 >$q.json if python -mjson.tool <$q.json >/dev/null; then echo " json ok" else echo " json format error" fi sudo tc qdisc del dev dummy0 root fi done