Thread (34 messages) 34 messages, 4 authors, 2011-03-04

Re: [PATCH] sched: QFQ - quick fair queue scheduler (v2)

flat view

From: Eric Dumazet <hidden>
Date: 2011-03-03 16:05:05

Le lundi 28 février 2011 à 17:17 -0800, Stephen Hemminger a écrit :

quoted hunk ↗ jump to hunk
+static int qfq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
+				struct gnet_dump *d)
+{
+	struct qfq_class *cl = (struct qfq_class *)arg;
+	struct tc_qfq_stats xstats;
+
+	memset(&xstats, 0, sizeof(xstats));
+
+	xstats.weight = ONE_FP/cl->inv_w;
+	xstats.lmax = cl->lmax;
+
cl->qdisc->qstats.qlen = cl->qdisc->q.qlen;
quoted hunk ↗ jump to hunk
+	if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
+	    gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 ||
+	    gnet_stats_copy_queue(d, &cl->qdisc->qstats) < 0)
+		return -1;
+
+	return gnet_stats_copy_app(d, &xstats, sizeof(xstats));
+}
+
using 
	gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 

is better : We avoid dumping null rate estimation, if admin never asked
a rate estimation...


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help