Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462230 > unrolled thread

[PATCH 3.16 193/305] net_sched: fix pfifo_head_drop behavior vs backlog

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-08-14 20:10 +0200
Last post2016-08-14 20:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 193/305] net_sched: fix pfifo_head_drop behavior vs  backlog Ben Hutchings <ben@decadent.org.uk> - 2016-08-14 20:10 +0200

#1462230 — [PATCH 3.16 193/305] net_sched: fix pfifo_head_drop behavior vs backlog

FromBen Hutchings <ben@decadent.org.uk>
Date2016-08-14 20:10 +0200
Subject[PATCH 3.16 193/305] net_sched: fix pfifo_head_drop behavior vs backlog
Message-ID<s681c-31c-23@gated-at.bofh.it>
3.16.37-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

commit 6c0d54f1897d229748d4f41ef919078db6db2123 upstream.

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sched/sch_fifo.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -37,14 +37,18 @@ static int pfifo_enqueue(struct sk_buff
 
 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);
 	sch->qstats.drops++;
 	qdisc_enqueue_tail(skb, sch);
 
+	qdisc_tree_reduce_backlog(sch, 0, prev_backlog - sch->qstats.backlog);
 	return NET_XMIT_CN;
 }
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web