blob: 6487317ea619c41d4ea662f1162417fa6c6e947f [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,
Eric Dumazet45203a32013-06-06 08:43:22 -070012 TCA_STATS_RATE_EST64,
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 __TCA_STATS_MAX,
14};
15#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
16
17/**
18 * struct gnet_stats_basic - byte/packet throughput statistics
19 * @bytes: number of seen bytes
20 * @packets: number of seen packets
21 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080022struct gnet_stats_basic {
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 __u64 bytes;
24 __u32 packets;
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000025};
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080026struct gnet_stats_basic_packed {
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000027 __u64 bytes;
28 __u32 packets;
Eric Dumazet5e140df2009-03-20 01:33:32 -070029} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31/**
32 * struct gnet_stats_rate_est - rate estimator
33 * @bps: current byte rate
34 * @pps: current packet rate
35 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080036struct gnet_stats_rate_est {
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 __u32 bps;
38 __u32 pps;
39};
40
41/**
Eric Dumazet45203a32013-06-06 08:43:22 -070042 * struct gnet_stats_rate_est64 - rate estimator
43 * @bps: current byte rate
44 * @pps: current packet rate
45 */
46struct gnet_stats_rate_est64 {
47 __u64 bps;
48 __u64 pps;
49};
50
51/**
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 * struct gnet_stats_queue - queuing statistics
53 * @qlen: queue length
54 * @backlog: backlog size of queue
55 * @drops: number of dropped packets
56 * @requeues: number of requeues
57 * @overlimits: number of enqueues over the limit
58 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080059struct gnet_stats_queue {
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 __u32 qlen;
61 __u32 backlog;
62 __u32 drops;
63 __u32 requeues;
64 __u32 overlimits;
65};
66
67/**
68 * struct gnet_estimator - rate estimator configuration
69 * @interval: sampling period
70 * @ewma_log: the log of measurement window weight
71 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080072struct gnet_estimator {
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 signed char interval;
74 unsigned char ewma_log;
75};
76
77
78#endif /* __LINUX_GEN_STATS_H */