From 2dd875ff31ac7ff42d6fc7d7f78ac6c0635439f5 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 10 May 2012 05:36:34 +0000 Subject: net_sched: update bstats in dequeue() Class bytes/packets stats can be misleading because they are updated in enqueue() while packet might be dropped later. We already fixed all qdiscs but sch_atm. This patch makes the final cleanup. class rate estimators can now match qdisc ones. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- net/sched/sch_drr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/sched/sch_drr.c') diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index c2189879359b..9ce0b4fe23ff 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c @@ -376,8 +376,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) cl->deficit = cl->quantum; } - bstats_update(&cl->bstats, skb); - sch->q.qlen++; return err; } @@ -403,6 +401,8 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) skb = qdisc_dequeue_peeked(cl->qdisc); if (cl->qdisc->q.qlen == 0) list_del(&cl->alist); + + bstats_update(&cl->bstats, skb); qdisc_bstats_update(sch, skb); sch->q.qlen--; return skb; -- cgit v1.2.3-59-g8ed1b