[PATCH RFC 3/3] Make pfifo_fast track qlen stats.

Toke Høiland-Jørgensen toke at toke.dk
Mon Jun 10 05:39:49 PDT 2013


---
 net/sched/sch_generic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 1b4e16d..0ca0d06 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -522,6 +522,8 @@ static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc)
 
 		priv->bitmap |= (1 << band);
 		qdisc->q.qlen++;
+		qdisc->qstats.qlen++;
+		qdisc->qstats.backlog += qdisc_pkt_len(skb);
 		return __qdisc_enqueue_tail(skb, qdisc, list);
 	}
 
@@ -538,6 +540,8 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)
 		struct sk_buff *skb = __qdisc_dequeue_head(qdisc, list);
 
 		qdisc->q.qlen--;
+		qdisc->qstats.qlen--;
+		qdisc->qstats.backlog -= qdisc_pkt_len(skb);
 		if (skb_queue_empty(list))
 			priv->bitmap &= ~(1 << band);
 
-- 
1.8.3



More information about the Bloat-devel mailing list