aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_hfsc.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-09-28 14:53:57 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-30 01:02:26 -0400
commit6401585366326fc0ecbc372ec60d1a15cd8be2f5 (patch)
treec3e8f777a579ee8b912e98d06ceb2aa1ffbb6a8b /net/sched/sch_hfsc.c
parent25331d6ce42bcf4b34b6705fce4da15c3fabe62f (diff)
net: sched: restrict use of qstats qlen
This removes the use of qstats->qlen variable from the classifiers and makes it an explicit argument to gnet_stats_copy_queue(). The qlen represents the qdisc queue length and is packed into the qstats at the last moment before passnig to user space. By handling it explicitely we avoid, in the percpu stats case, having to figure out which per_cpu variable to put it in. It would probably be best to remove it from qstats completely but qstats is a user space ABI and can't be broken. A future patch could make an internal only qstats structure that would avoid having to allocate an additional u32 variable on the Qdisc struct. This would make the qstats struct 128bits instead of 128+32. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r--net/sched/sch_hfsc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index ad278251d811..d364acb2ad07 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1370,7 +1370,6 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg,
1370 struct hfsc_class *cl = (struct hfsc_class *)arg; 1370 struct hfsc_class *cl = (struct hfsc_class *)arg;
1371 struct tc_hfsc_stats xstats; 1371 struct tc_hfsc_stats xstats;
1372 1372
1373 cl->qstats.qlen = cl->qdisc->q.qlen;
1374 cl->qstats.backlog = cl->qdisc->qstats.backlog; 1373 cl->qstats.backlog = cl->qdisc->qstats.backlog;
1375 xstats.level = cl->level; 1374 xstats.level = cl->level;
1376 xstats.period = cl->cl_vtperiod; 1375 xstats.period = cl->cl_vtperiod;
@@ -1379,7 +1378,7 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg,
1379 1378
1380 if (gnet_stats_copy_basic(d, NULL, &cl->bstats) < 0 || 1379 if (gnet_stats_copy_basic(d, NULL, &cl->bstats) < 0 ||
1381 gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 || 1380 gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
1382 gnet_stats_copy_queue(d, &cl->qstats) < 0) 1381 gnet_stats_copy_queue(d, &cl->qstats, cl->qdisc->q.qlen) < 0)
1383 return -1; 1382 return -1;
1384 1383
1385 return gnet_stats_copy_app(d, &xstats, sizeof(xstats)); 1384 return gnet_stats_copy_app(d, &xstats, sizeof(xstats));