Skip to content

Commit 6c0d54f

Browse files
edumazetdavem330
authored andcommitted
net_sched: fix pfifo_head_drop behavior vs backlog
When the qdisc is full, we drop a packet at the head of the queue, queue the current skb and return NET_XMIT_CN Now we track backlog on upper qdiscs, we need to call qdisc_tree_reduce_backlog(), even if the qlen did not change. Fixes: 2ccccf5 ("net_sched: update hierarchical backlog too") Signed-off-by: Eric Dumazet <[email protected]> Cc: WANG Cong <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Acked-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 881d032 commit 6c0d54f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/sched/sch_fifo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@ static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
3737

3838
static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)
3939
{
40+
unsigned int prev_backlog;
41+
4042
if (likely(skb_queue_len(&sch->q) < sch->limit))
4143
return qdisc_enqueue_tail(skb, sch);
4244

45+
prev_backlog = sch->qstats.backlog;
4346
/* queue full, remove one skb to fulfill the limit */
4447
__qdisc_queue_drop_head(sch, &sch->q);
4548
qdisc_qstats_drop(sch);
4649
qdisc_enqueue_tail(skb, sch);
4750

51+
qdisc_tree_reduce_backlog(sch, 0, prev_backlog - sch->qstats.backlog);
4852
return NET_XMIT_CN;
4953
}
5054

0 commit comments

Comments
 (0)