]>
Commit | Line | Data |
---|---|---|
6f52b16c | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
1da177e4 LT |
2 | #ifndef __LINUX_GEN_STATS_H |
3 | #define __LINUX_GEN_STATS_H | |
4 | ||
5 | #include <linux/types.h> | |
6 | ||
7 | enum { | |
8 | TCA_STATS_UNSPEC, | |
9 | TCA_STATS_BASIC, | |
10 | TCA_STATS_RATE_EST, | |
11 | TCA_STATS_QUEUE, | |
12 | TCA_STATS_APP, | |
45203a3b | 13 | TCA_STATS_RATE_EST64, |
9854518e | 14 | TCA_STATS_PAD, |
1da177e4 LT |
15 | __TCA_STATS_MAX, |
16 | }; | |
17 | #define TCA_STATS_MAX (__TCA_STATS_MAX - 1) | |
18 | ||
19 | /** | |
20 | * struct gnet_stats_basic - byte/packet throughput statistics | |
21 | * @bytes: number of seen bytes | |
22 | * @packets: number of seen packets | |
23 | */ | |
d94d9fee | 24 | struct gnet_stats_basic { |
c1a8f1f1 ED |
25 | __u64 bytes; |
26 | __u32 packets; | |
27 | }; | |
d94d9fee | 28 | struct gnet_stats_basic_packed { |
1da177e4 LT |
29 | __u64 bytes; |
30 | __u32 packets; | |
5e140dfc | 31 | } __attribute__ ((packed)); |
1da177e4 LT |
32 | |
33 | /** | |
34 | * struct gnet_stats_rate_est - rate estimator | |
35 | * @bps: current byte rate | |
36 | * @pps: current packet rate | |
37 | */ | |
d94d9fee | 38 | struct gnet_stats_rate_est { |
1da177e4 LT |
39 | __u32 bps; |
40 | __u32 pps; | |
41 | }; | |
42 | ||
45203a3b ED |
43 | /** |
44 | * struct gnet_stats_rate_est64 - rate estimator | |
45 | * @bps: current byte rate | |
46 | * @pps: current packet rate | |
47 | */ | |
48 | struct gnet_stats_rate_est64 { | |
49 | __u64 bps; | |
50 | __u64 pps; | |
51 | }; | |
52 | ||
1da177e4 LT |
53 | /** |
54 | * struct gnet_stats_queue - queuing statistics | |
55 | * @qlen: queue length | |
56 | * @backlog: backlog size of queue | |
57 | * @drops: number of dropped packets | |
58 | * @requeues: number of requeues | |
59 | * @overlimits: number of enqueues over the limit | |
60 | */ | |
d94d9fee | 61 | struct gnet_stats_queue { |
1da177e4 LT |
62 | __u32 qlen; |
63 | __u32 backlog; | |
64 | __u32 drops; | |
65 | __u32 requeues; | |
66 | __u32 overlimits; | |
67 | }; | |
68 | ||
69 | /** | |
70 | * struct gnet_estimator - rate estimator configuration | |
71 | * @interval: sampling period | |
72 | * @ewma_log: the log of measurement window weight | |
73 | */ | |
d94d9fee | 74 | struct gnet_estimator { |
1da177e4 LT |
75 | signed char interval; |
76 | unsigned char ewma_log; | |
77 | }; | |
78 | ||
79 | ||
80 | #endif /* __LINUX_GEN_STATS_H */ |