diff options
author | Eric Dumazet <edumazet@google.com> | 2012-05-10 01:36:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 23:33:01 -0400 |
commit | 2dd875ff31ac7ff42d6fc7d7f78ac6c0635439f5 (patch) | |
tree | c75209ccd8374f9695d4ec854d5b4bfb80c5e0dc /net/sched/sch_drr.c | |
parent | a6700db17980972199e61c06be535a79e1b0b4e6 (diff) |
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 <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_drr.c')
-rw-r--r-- | net/sched/sch_drr.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
376 | cl->deficit = cl->quantum; | 376 | cl->deficit = cl->quantum; |
377 | } | 377 | } |
378 | 378 | ||
379 | bstats_update(&cl->bstats, skb); | ||
380 | |||
381 | sch->q.qlen++; | 379 | sch->q.qlen++; |
382 | return err; | 380 | return err; |
383 | } | 381 | } |
@@ -403,6 +401,8 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) | |||
403 | skb = qdisc_dequeue_peeked(cl->qdisc); | 401 | skb = qdisc_dequeue_peeked(cl->qdisc); |
404 | if (cl->qdisc->q.qlen == 0) | 402 | if (cl->qdisc->q.qlen == 0) |
405 | list_del(&cl->alist); | 403 | list_del(&cl->alist); |
404 | |||
405 | bstats_update(&cl->bstats, skb); | ||
406 | qdisc_bstats_update(sch, skb); | 406 | qdisc_bstats_update(sch, skb); |
407 | sch->q.qlen--; | 407 | sch->q.qlen--; |
408 | return skb; | 408 | return skb; |