Skip to content

Commit 5eb7de8

Browse files
Lion Ackermanndavem330
Lion Ackermann
authored andcommitted
net: sched: fix ordering of qlen adjustment
Changes to sch->q.qlen around qdisc_tree_reduce_backlog() need to happen _before_ a call to said function because otherwise it may fail to notify parent qdiscs when the child is about to become empty. Signed-off-by: Lion Ackermann <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2922078 commit 5eb7de8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/sched/sch_cake.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,6 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
15251525
b->backlogs[idx] -= len;
15261526
b->tin_backlog -= len;
15271527
sch->qstats.backlog -= len;
1528-
qdisc_tree_reduce_backlog(sch, 1, len);
15291528

15301529
flow->dropped++;
15311530
b->tin_dropped++;
@@ -1536,6 +1535,7 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
15361535

15371536
__qdisc_drop(skb, to_free);
15381537
sch->q.qlen--;
1538+
qdisc_tree_reduce_backlog(sch, 1, len);
15391539

15401540
cake_heapify(q, 0);
15411541

net/sched/sch_choke.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx,
123123
if (idx == q->tail)
124124
choke_zap_tail_holes(q);
125125

126+
--sch->q.qlen;
126127
qdisc_qstats_backlog_dec(sch, skb);
127128
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
128129
qdisc_drop(skb, sch, to_free);
129-
--sch->q.qlen;
130130
}
131131

132132
struct choke_skb_cb {

0 commit comments

Comments
 (0)