diff options
author | Eric Dumazet <edumazet@google.com> | 2013-06-06 11:43:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-11 05:51:03 -0400 |
commit | 45203a3b380cee28f570475c0d28c169f908c209 (patch) | |
tree | 9d9b00da9accbc0ea01c91c206cb86a2f9dd7609 /include/net/gen_stats.h | |
parent | b41abb42bf62a85a32c41dab873220598a6ee266 (diff) |
net_sched: add 64bit rate estimators
struct gnet_stats_rate_est contains u32 fields, so the bytes per second
field can wrap at 34360Mbit.
Add a new gnet_stats_rate_est64 structure to get 64bit bps/pps fields,
and switch the kernel to use this structure natively.
This structure is dumped to user space as a new attribute :
TCA_STATS_RATE_EST64
Old tc command will now display the capped bps (to 34360Mbit), instead
of wrapped values, and updated tc command will display correct
information.
Old tc command output, after patch :
eric:~# tc -s -d qd sh dev lo
qdisc pfifo 8001: root refcnt 2 limit 1000p
Sent 80868245400 bytes 1978837 pkt (dropped 0, overlimits 0 requeues 0)
rate 34360Mbit 189696pps backlog 0b 0p requeues 0
This patch carefully reorganizes "struct Qdisc" layout to get optimal
performance on SMP.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/gen_stats.h')
-rw-r--r-- | include/net/gen_stats.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index a79b6cfb02a8..cf8439ba4d11 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
@@ -30,7 +30,7 @@ extern int gnet_stats_copy_basic(struct gnet_dump *d, | |||
30 | struct gnet_stats_basic_packed *b); | 30 | struct gnet_stats_basic_packed *b); |
31 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 31 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, |
32 | const struct gnet_stats_basic_packed *b, | 32 | const struct gnet_stats_basic_packed *b, |
33 | struct gnet_stats_rate_est *r); | 33 | struct gnet_stats_rate_est64 *r); |
34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, |
35 | struct gnet_stats_queue *q); | 35 | struct gnet_stats_queue *q); |
36 | extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); | 36 | extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); |
@@ -38,13 +38,13 @@ extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); | |||
38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); | 38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); |
39 | 39 | ||
40 | extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, | 40 | extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
41 | struct gnet_stats_rate_est *rate_est, | 41 | struct gnet_stats_rate_est64 *rate_est, |
42 | spinlock_t *stats_lock, struct nlattr *opt); | 42 | spinlock_t *stats_lock, struct nlattr *opt); |
43 | extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, | 43 | extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, |
44 | struct gnet_stats_rate_est *rate_est); | 44 | struct gnet_stats_rate_est64 *rate_est); |
45 | extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, | 45 | extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, |
46 | struct gnet_stats_rate_est *rate_est, | 46 | struct gnet_stats_rate_est64 *rate_est, |
47 | spinlock_t *stats_lock, struct nlattr *opt); | 47 | spinlock_t *stats_lock, struct nlattr *opt); |
48 | extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, | 48 | extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, |
49 | const struct gnet_stats_rate_est *rate_est); | 49 | const struct gnet_stats_rate_est64 *rate_est); |
50 | #endif | 50 | #endif |