-----Original Message----- From: Stephen Hemminger stephen@networkplumber.org Sent: Monday, March 17, 2025 2:36 PM To: Chia-Yu Chang (Nokia) chia-yu.chang@nokia-bell-labs.com Cc: netdev@vger.kernel.org; dave.taht@gmail.com; pabeni@redhat.com; jhs@mojatatu.com; kuba@kernel.org; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; horms@kernel.org; andrew+netdev@lunn.ch; donald.hunter@gmail.com; ast@fiberby.net; liuhangbin@gmail.com; shuah@kernel.org; linux-kselftest@vger.kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) koen.de_schepper@nokia-bell-labs.com; g.white g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel vidhi_goel@apple.com; Olga Albisser olga@albisser.org; Olivier Tilmans (Nokia) olivier.tilmans@nokia.com; Bob Briscoe research@bobbriscoe.net; Henrik Steen henrist@henrist.net Subject: Re: [PATCH v4 iproute2-next 1/1] tc: add dualpi2 scheduler module
CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
On Sun, 16 Mar 2025 16:39:17 +0100 chia-yu.chang@nokia-bell-labs.com wrote:
+static int dualpi2_print_xstats(struct qdisc_util *qu, FILE *f,
struct rtattr *xstats) {
struct tc_dualpi2_xstats *st;
if (xstats == NULL)
return 0;
if (RTA_PAYLOAD(xstats) < sizeof(*st))
return -1;
st = RTA_DATA(xstats);
fprintf(f, "prob %f delay_c %uus delay_l %uus\n",
(double)st->prob / (double)MAX_PROB, st->delay_c, st->delay_l);
fprintf(f, "pkts_in_c %u pkts_in_l %u maxq %u\n",
st->packets_in_c, st->packets_in_l, st->maxq);
fprintf(f, "ecn_mark %u step_marks %u\n", st->ecn_mark, st->step_marks);
fprintf(f, "credit %d (%c)\n", st->credit, st->credit > 0 ? 'C' : 'L');
fprintf(f, "memory used %u (max %u) of memory limit %u\n",
st->memory_used, st->max_memory_used, st->memory_limit);
return 0;
You should support JSON for the stats as well.
Sure, will do that in the next version.