Skip to contentSkip to conversation

net_sched/hhf: update hierarchical backlog when drop packet

PATCH In review Konstantin Khlebnikov 3 participants 4 messages Aug 21, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net_sched/hhf: update hierarchical backlog when drop packet

When hhf_enqueue() drops packet from another bucket it have to update backlog at upper qdiscs too.

Fixes 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
---
 net/sched/sch_hhf.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/sch_hhf.c +4 -1
index 51d3ba682af9..c8d84436e427 100644
@@ -406,8 +406,11 @@ static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	/* Return Congestion Notification only if we dropped a packet from this
 	 * bucket.
 	 */
-	if (hhf_drop(sch, to_free) == idx)
+	if (hhf_drop(sch, to_free) == idx) {
+		qdisc_tree_reduce_backlog(sch, 0,
+					  prev_backlog - sch->qstats.backlog);
 		return NET_XMIT_CN;
+	}
 
 	/* As we dropped a packet, better let upper stack know this. */
 	qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);
#1 lore raw
Quoted 14 lines · Konstantin Khlebnikov

When hhf_enqueue() drops packet from another bucket it have to update backlog at upper qdiscs too.

Fixes 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
---
 net/sched/sch_hhf.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/sch_hhf.c +0 -0
index 51d3ba682af9..c8d84436e427 100644

net/sched/sch_hhf.c static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch, · line 410

Quoted 6 lines
net/sched/sch_hhf.c +2 -1
@@ -406,8 +406,11 @@ static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
        /* Return Congestion Notification only if we dropped a packet from this
         * bucket.
         */
-       if (hhf_drop(sch, to_free) == idx)
+       if (hhf_drop(sch, to_free) == idx) {
+               qdisc_tree_reduce_backlog(sch, 0,

It should be 1 here instead of 0, because one packet is dropped even if hhf_drop() == idx.

Quoted 7 lines
net/sched/sch_hhf.c +2 -0
+                                         prev_backlog - sch->qstats.backlog);
                return NET_XMIT_CN;
+       }
 
        /* As we dropped a packet, better let upper stack know this. */
        qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

Emails encoded in HTML will be blocked by the list server, and quite frankly I just outright delete all emails which I receive which are HTML encoded as well.

Just FYI...

#4 lore raw
In reply to a message not in the archive
Quoted 3 lines · Konstantin Khlebnikov

Current packet wouldn't be counted by parent either. So queue length isn't changed.

But the qdisc_tree_reduce_backlog() right below uses 1 too:

        /* As we dropped a packet, better let upper stack know this. */
        qdisc_tree_reduce_backlog(sch, 1, prev_backlog - sch->qstats.backlog);
        return NET_XMIT_SUCCESS;