Stephen Hemminger <step...@networkplumber.org> writes: > On Tue, 24 Apr 2018 14:30:46 +0200 > Toke Høiland-Jørgensen <t...@toke.dk> wrote: > >> +static void cake_print_json_tin(struct tc_cake_tin_stats *tst, uint version) >> +{ >> + 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_hits); >> + 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_flows); >> + print_uint(PRINT_JSON, "max_pkt_len", NULL, tst->max_skblen); >> + if (version >= 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