aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_prio.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r--net/sched/sch_prio.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 2567b4c96c1e..9f957ca5073b 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -7,7 +7,7 @@
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8 * 8 *
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10 * Fixes: 19990609: J Hadi Salim <hadi@nortelnetworks.com>: 10 * Fixes: 19990609: J Hadi Salim <hadi@nortelnetworks.com>:
11 * Init -- EINVAL when opt undefined 11 * Init -- EINVAL when opt undefined
12 */ 12 */
13 13
@@ -105,7 +105,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch)
105 return NET_XMIT_SUCCESS; 105 return NET_XMIT_SUCCESS;
106 } 106 }
107 sch->qstats.drops++; 107 sch->qstats.drops++;
108 return ret; 108 return ret;
109} 109}
110 110
111 111
@@ -372,6 +372,20 @@ static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *
372 return 0; 372 return 0;
373} 373}
374 374
375static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
376 struct gnet_dump *d)
377{
378 struct prio_sched_data *q = qdisc_priv(sch);
379 struct Qdisc *cl_q;
380
381 cl_q = q->queues[cl - 1];
382 if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 ||
383 gnet_stats_copy_queue(d, &cl_q->qstats) < 0)
384 return -1;
385
386 return 0;
387}
388
375static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg) 389static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
376{ 390{
377 struct prio_sched_data *q = qdisc_priv(sch); 391 struct prio_sched_data *q = qdisc_priv(sch);
@@ -414,6 +428,7 @@ static struct Qdisc_class_ops prio_class_ops = {
414 .bind_tcf = prio_bind, 428 .bind_tcf = prio_bind,
415 .unbind_tcf = prio_put, 429 .unbind_tcf = prio_put,
416 .dump = prio_dump_class, 430 .dump = prio_dump_class,
431 .dump_stats = prio_dump_class_stats,
417}; 432};
418 433
419static struct Qdisc_ops prio_qdisc_ops = { 434static struct Qdisc_ops prio_qdisc_ops = {
@@ -438,7 +453,7 @@ static int __init prio_module_init(void)
438 return register_qdisc(&prio_qdisc_ops); 453 return register_qdisc(&prio_qdisc_ops);
439} 454}
440 455
441static void __exit prio_module_exit(void) 456static void __exit prio_module_exit(void)
442{ 457{
443 unregister_qdisc(&prio_qdisc_ops); 458 unregister_qdisc(&prio_qdisc_ops);
444} 459}