blob: 552c8a0a12d15f11f6ac2b3b1a27d17a94044f8b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __LINUX_GEN_STATS_H
2#define __LINUX_GEN_STATS_H
3
4#include <linux/types.h>
5
6enum {
7 TCA_STATS_UNSPEC,
8 TCA_STATS_BASIC,
9 TCA_STATS_RATE_EST,
10 TCA_STATS_QUEUE,
11 TCA_STATS_APP,
12 __TCA_STATS_MAX,
13};
14#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
15
16/**
17 * struct gnet_stats_basic - byte/packet throughput statistics
18 * @bytes: number of seen bytes
19 * @packets: number of seen packets
20 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080021struct gnet_stats_basic {
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 __u64 bytes;
23 __u32 packets;
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000024};
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080025struct gnet_stats_basic_packed {
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000026 __u64 bytes;
27 __u32 packets;
Eric Dumazet5e140df2009-03-20 01:33:32 -070028} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30/**
31 * struct gnet_stats_rate_est - rate estimator
32 * @bps: current byte rate
33 * @pps: current packet rate
34 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080035struct gnet_stats_rate_est {
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 __u32 bps;
37 __u32 pps;
38};
39
40/**
41 * struct gnet_stats_queue - queuing statistics
42 * @qlen: queue length
43 * @backlog: backlog size of queue
44 * @drops: number of dropped packets
45 * @requeues: number of requeues
46 * @overlimits: number of enqueues over the limit
47 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080048struct gnet_stats_queue {
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 __u32 qlen;
50 __u32 backlog;
51 __u32 drops;
52 __u32 requeues;
53 __u32 overlimits;
54};
55
56/**
57 * struct gnet_estimator - rate estimator configuration
58 * @interval: sampling period
59 * @ewma_log: the log of measurement window weight
60 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080061struct gnet_estimator {
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 signed char interval;
63 unsigned char ewma_log;
64};
65
66
67#endif /* __LINUX_GEN_STATS_H */