net_sched/sfq: update hierarchical backlog when drop packet
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Tue, 15 Aug 2017 13:37:04 +0000 (16:37 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 00:16:39 +0000 (17:16 -0700)
When sfq_enqueue() drops head packet or packet from another queue it
have to update backlog at upper qdiscs too.

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_sfq.c

index f80ea2cc5f1f4bdee2452c930e3650f79397f3a1..82469ef9655eb65431477215bb2df0fb2737f905 100644 (file)
@@ -437,6 +437,7 @@ congestion_drop:
                qdisc_drop(head, sch, to_free);
 
                slot_queue_add(slot, skb);
+               qdisc_tree_reduce_backlog(sch, 0, delta);
                return NET_XMIT_CN;
        }
 
@@ -468,8 +469,10 @@ enqueue:
        /* Return Congestion Notification only if we dropped a packet
         * from this flow.
         */
-       if (qlen != slot->qlen)
+       if (qlen != slot->qlen) {
+               qdisc_tree_reduce_backlog(sch, 0, dropped - qdisc_pkt_len(skb));
                return NET_XMIT_CN;
+       }
 
        /* As we dropped a packet, better let upper stack know this */
        qdisc_tree_reduce_backlog(sch, 1, dropped);