Skip to content
Snippets Groups Projects
Commit 3c75f6ee authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net_sched: sch_htb: add per class overlimits counter


HTB qdisc overlimits counter is properly increased, but we have no per
class counter, meaning it is difficult to diagnose HTB problems.

This patch adds this counter, visible in "tc -s class show dev eth0",
with current iproute2.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarDenys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7e5dd53f
No related branches found
No related tags found
No related merge requests found
...@@ -142,6 +142,7 @@ struct htb_class { ...@@ -142,6 +142,7 @@ struct htb_class {
struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */ struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */
unsigned int drops ____cacheline_aligned_in_smp; unsigned int drops ____cacheline_aligned_in_smp;
unsigned int overlimits;
}; };
struct htb_level { struct htb_level {
...@@ -533,6 +534,9 @@ htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, s64 *diff) ...@@ -533,6 +534,9 @@ htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, s64 *diff)
if (new_mode == cl->cmode) if (new_mode == cl->cmode)
return; return;
if (new_mode == HTB_CANT_SEND)
cl->overlimits++;
if (cl->prio_activity) { /* not necessary: speed optimization */ if (cl->prio_activity) { /* not necessary: speed optimization */
if (cl->cmode != HTB_CANT_SEND) if (cl->cmode != HTB_CANT_SEND)
htb_deactivate_prios(q, cl); htb_deactivate_prios(q, cl);
...@@ -1143,6 +1147,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) ...@@ -1143,6 +1147,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d)
struct htb_class *cl = (struct htb_class *)arg; struct htb_class *cl = (struct htb_class *)arg;
struct gnet_stats_queue qs = { struct gnet_stats_queue qs = {
.drops = cl->drops, .drops = cl->drops,
.overlimits = cl->overlimits,
}; };
__u32 qlen = 0; __u32 qlen = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment