diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2017-08-15 16:39:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-16 10:55:34 -0700 |
commit | 959466588aa7f84ccf79ae36a1d89542eaf9aaec (patch) | |
tree | 92eb64dfd551fdcf0b9e09b113fe59bc3f178557 /net/sched/sch_htb.c | |
parent | 869cec99b4f7c4b97e3e912529cf8505ed1e6c25 (diff) |
net_sched: call qlen_notify only if child qdisc is empty
This callback is used for deactivating class in parent qdisc.
This is cheaper to test queue length right here.
Also this allows to catch draining screwed backlog and prevent
second deactivation of already inactive parent class which will
crash kernel for sure. Kernel with print warning at destruction
of child qdisc where no packets but backlog is not zero.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r-- | net/sched/sch_htb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 5d65ec5207e9..dcf3c85e1f4f 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -1186,8 +1186,7 @@ static void htb_qlen_notify(struct Qdisc *sch, unsigned long arg) { struct htb_class *cl = (struct htb_class *)arg; - if (cl->un.leaf.q->q.qlen == 0) - htb_deactivate(qdisc_priv(sch), cl); + htb_deactivate(qdisc_priv(sch), cl); } static unsigned long htb_get(struct Qdisc *sch, u32 classid) |