net_sched: accurate bytes/packets stats/rates
commit9190b3b3208d052d98cb601fcc192f3f71a5658b
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 21 Jan 2011 07:31:33 +0000 (20 23:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jan 2011 07:31:33 +0000 (20 23:31 -0800)
treeb642a00320a1b35e33741fcd162072724f228fbf
parentb30532515f0a62bfe17207ab00883dd262497006
net_sched: accurate bytes/packets stats/rates

In commit 44b8288308ac9d (net_sched: pfifo_head_drop problem), we fixed
a problem with pfifo_head drops that incorrectly decreased
sch->bstats.bytes and sch->bstats.packets

Several qdiscs (CHOKe, SFQ, pfifo_head, ...) are able to drop a
previously enqueued packet, and bstats cannot be changed, so
bstats/rates are not accurate (over estimated)

This patch changes the qdisc_bstats updates to be done at dequeue() time
instead of enqueue() time. bstats counters no longer account for dropped
frames, and rates are more correct, since enqueue() bursts dont have
effect on dequeue() rate.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 files changed:
include/net/sch_generic.h
net/sched/sch_cbq.c
net/sched/sch_drr.c
net/sched/sch_dsmark.c
net/sched/sch_fifo.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_multiq.c
net/sched/sch_netem.c
net/sched/sch_prio.c
net/sched/sch_red.c
net/sched/sch_sfq.c
net/sched/sch_tbf.c
net/sched/sch_teql.c