From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [Cake] [PATCH iproute2-next v3] Add support for cake qdisc Date: Tue, 24 Apr 2018 16:52:57 +0200 Message-ID: <87efj47j1y.fsf@toke.dk> References: <20180424114407.5939-2-toke@toke.dk> <20180424123046.21247-1-toke@toke.dk> <20180424074552.397564a5@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net To: Stephen Hemminger Return-path: Received: from mail.toke.dk ([52.28.52.200]:45257 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbeDXOw7 (ORCPT ); Tue, 24 Apr 2018 10:52:59 -0400 In-Reply-To: <20180424074552.397564a5@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: Stephen Hemminger writes: > On Tue, 24 Apr 2018 14:30:46 +0200 > Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> +static void cake_print_json_tin(struct tc_cake_tin_stats *tst, uint ver= sion) >> +{ >> + open_json_object(NULL); >> + print_uint(PRINT_JSON, "threshold_rate", NULL, tst->threshold_rate); >> + print_uint(PRINT_JSON, "target", NULL, tst->target_us); >> + print_uint(PRINT_JSON, "interval", NULL, tst->interval_us); >> + print_uint(PRINT_JSON, "peak_delay", NULL, tst->peak_delay_us); >> + print_uint(PRINT_JSON, "average_delay", NULL, tst->avge_delay_us); >> + print_uint(PRINT_JSON, "base_delay", NULL, tst->base_delay_us); >> + print_uint(PRINT_JSON, "sent_packets", NULL, tst->sent.packets); >> + print_uint(PRINT_JSON, "sent_bytes", NULL, tst->sent.bytes); >> + print_uint(PRINT_JSON, "way_indirect_hits", NULL, tst->way_indirect_hi= ts); >> + print_uint(PRINT_JSON, "way_misses", NULL, tst->way_misses); >> + print_uint(PRINT_JSON, "way_collisions", NULL, tst->way_collisions); >> + print_uint(PRINT_JSON, "drops", NULL, tst->dropped.packets); >> + print_uint(PRINT_JSON, "ecn_mark", NULL, tst->ecn_marked.packets); >> + print_uint(PRINT_JSON, "ack_drops", NULL, tst->ack_drops.packets); >> + print_uint(PRINT_JSON, "sparse_flows", NULL, tst->sparse_flows); >> + print_uint(PRINT_JSON, "bulk_flows", NULL, tst->bulk_flows); >> + print_uint(PRINT_JSON, "unresponsive_flows", NULL, tst->unresponse_flo= ws); >> + print_uint(PRINT_JSON, "max_pkt_len", NULL, tst->max_skblen); >> + if (version >=3D 0x102) >> + print_uint(PRINT_JSON, "flow_quantum", NULL, tst->flow_quantum); > > Please don't version objects in netlink. That is not how netlink is > supposed to be used. Well, this is leftover from keeping track of different versions of the out-of-tree patch, and we already broke compatibility pretty thoroughly as a preparation for upstreaming. So I'm fine with dropping the version check; will resend. That being said, the versioning comes from the XSTATS API, which does not use netlink attributes for its members, but rather passes through as struct. So what is one supposed to do in this case? -Toke