* [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog
@ 2016-06-13 3:01 Eric Dumazet
2016-06-13 3:48 ` Cong Wang
2016-06-14 21:19 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2016-06-13 3:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, WANG Cong, Jamal Hadi Salim
From: Eric Dumazet <edumazet@google.com>
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: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
---
net/sched/sch_fifo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index 2177eac0a61e..2e4bd2c0a50c 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -37,14 +37,18 @@ static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch)
static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
+ unsigned int prev_backlog;
+
if (likely(skb_queue_len(&sch->q) < sch->limit))
return qdisc_enqueue_tail(skb, sch);
+ prev_backlog = sch->qstats.backlog;
/* queue full, remove one skb to fulfill the limit */
__qdisc_queue_drop_head(sch, &sch->q);
qdisc_qstats_drop(sch);
qdisc_enqueue_tail(skb, sch);
+ qdisc_tree_reduce_backlog(sch, 0, prev_backlog - sch->qstats.backlog);
return NET_XMIT_CN;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog
2016-06-13 3:01 [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog Eric Dumazet
@ 2016-06-13 3:48 ` Cong Wang
2016-06-14 21:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Cong Wang @ 2016-06-13 3:48 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Jamal Hadi Salim
On Sun, Jun 12, 2016 at 8:01 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 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: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog
2016-06-13 3:01 [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog Eric Dumazet
2016-06-13 3:48 ` Cong Wang
@ 2016-06-14 21:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-06-14 21:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, xiyou.wangcong, jhs
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 12 Jun 2016 20:01:25 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> 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: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-14 21:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 3:01 [PATCH net] net_sched: fix pfifo_head_drop behavior vs backlog Eric Dumazet
2016-06-13 3:48 ` Cong Wang
2016-06-14 21:19 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).