Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_GEN_STATS_H |
| 2 | #define __LINUX_GEN_STATS_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
| 6 | enum { |
| 7 | TCA_STATS_UNSPEC, |
| 8 | TCA_STATS_BASIC, |
| 9 | TCA_STATS_RATE_EST, |
| 10 | TCA_STATS_QUEUE, |
| 11 | TCA_STATS_APP, |
Eric Dumazet | 45203a3 | 2013-06-06 08:43:22 -0700 | [diff] [blame] | 12 | TCA_STATS_RATE_EST64, |
Nicolas Dichtel | 9854518 | 2016-04-26 10:06:18 +0200 | [diff] [blame] | 13 | TCA_STATS_PAD, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | __TCA_STATS_MAX, |
| 15 | }; |
| 16 | #define TCA_STATS_MAX (__TCA_STATS_MAX - 1) |
| 17 | |
| 18 | /** |
| 19 | * struct gnet_stats_basic - byte/packet throughput statistics |
| 20 | * @bytes: number of seen bytes |
| 21 | * @packets: number of seen packets |
| 22 | */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 23 | struct gnet_stats_basic { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | __u64 bytes; |
| 25 | __u32 packets; |
Eric Dumazet | c1a8f1f | 2009-08-16 09:36:49 +0000 | [diff] [blame] | 26 | }; |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 27 | struct gnet_stats_basic_packed { |
Eric Dumazet | c1a8f1f | 2009-08-16 09:36:49 +0000 | [diff] [blame] | 28 | __u64 bytes; |
| 29 | __u32 packets; |
Eric Dumazet | 5e140df | 2009-03-20 01:33:32 -0700 | [diff] [blame] | 30 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * struct gnet_stats_rate_est - rate estimator |
| 34 | * @bps: current byte rate |
| 35 | * @pps: current packet rate |
| 36 | */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 37 | struct gnet_stats_rate_est { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | __u32 bps; |
| 39 | __u32 pps; |
| 40 | }; |
| 41 | |
| 42 | /** |
Eric Dumazet | 45203a3 | 2013-06-06 08:43:22 -0700 | [diff] [blame] | 43 | * struct gnet_stats_rate_est64 - rate estimator |
| 44 | * @bps: current byte rate |
| 45 | * @pps: current packet rate |
| 46 | */ |
| 47 | struct gnet_stats_rate_est64 { |
| 48 | __u64 bps; |
| 49 | __u64 pps; |
| 50 | }; |
| 51 | |
| 52 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | * struct gnet_stats_queue - queuing statistics |
| 54 | * @qlen: queue length |
| 55 | * @backlog: backlog size of queue |
| 56 | * @drops: number of dropped packets |
| 57 | * @requeues: number of requeues |
| 58 | * @overlimits: number of enqueues over the limit |
| 59 | */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 60 | struct gnet_stats_queue { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | __u32 qlen; |
| 62 | __u32 backlog; |
| 63 | __u32 drops; |
| 64 | __u32 requeues; |
| 65 | __u32 overlimits; |
| 66 | }; |
| 67 | |
| 68 | /** |
| 69 | * struct gnet_estimator - rate estimator configuration |
| 70 | * @interval: sampling period |
| 71 | * @ewma_log: the log of measurement window weight |
| 72 | */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 73 | struct gnet_estimator { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | signed char interval; |
| 75 | unsigned char ewma_log; |
| 76 | }; |
| 77 | |
| 78 | |
| 79 | #endif /* __LINUX_GEN_STATS_H */ |