blob: 065408e16a807be59fec72ae7a9fec99b8fd383f [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef __LINUX_GEN_STATS_H
3#define __LINUX_GEN_STATS_H
4
5#include <linux/types.h>
6
7enum {
8 TCA_STATS_UNSPEC,
9 TCA_STATS_BASIC,
10 TCA_STATS_RATE_EST,
11 TCA_STATS_QUEUE,
12 TCA_STATS_APP,
Eric Dumazet45203a32013-06-06 08:43:22 -070013 TCA_STATS_RATE_EST64,
Nicolas Dichtel98545182016-04-26 10:06:18 +020014 TCA_STATS_PAD,
Eelco Chaudron5e111212018-09-21 07:13:54 -040015 TCA_STATS_BASIC_HW,
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 __TCA_STATS_MAX,
17};
18#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
19
20/**
21 * struct gnet_stats_basic - byte/packet throughput statistics
22 * @bytes: number of seen bytes
23 * @packets: number of seen packets
24 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080025struct gnet_stats_basic {
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 __u64 bytes;
27 __u32 packets;
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000028};
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080029struct gnet_stats_basic_packed {
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000030 __u64 bytes;
31 __u32 packets;
Eric Dumazet5e140df2009-03-20 01:33:32 -070032} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
34/**
35 * struct gnet_stats_rate_est - rate estimator
36 * @bps: current byte rate
37 * @pps: current packet rate
38 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080039struct gnet_stats_rate_est {
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 __u32 bps;
41 __u32 pps;
42};
43
44/**
Eric Dumazet45203a32013-06-06 08:43:22 -070045 * struct gnet_stats_rate_est64 - rate estimator
46 * @bps: current byte rate
47 * @pps: current packet rate
48 */
49struct gnet_stats_rate_est64 {
50 __u64 bps;
51 __u64 pps;
52};
53
54/**
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 * struct gnet_stats_queue - queuing statistics
56 * @qlen: queue length
57 * @backlog: backlog size of queue
58 * @drops: number of dropped packets
59 * @requeues: number of requeues
60 * @overlimits: number of enqueues over the limit
61 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080062struct gnet_stats_queue {
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 __u32 qlen;
64 __u32 backlog;
65 __u32 drops;
66 __u32 requeues;
67 __u32 overlimits;
68};
69
70/**
71 * struct gnet_estimator - rate estimator configuration
72 * @interval: sampling period
73 * @ewma_log: the log of measurement window weight
74 */
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080075struct gnet_estimator {
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 signed char interval;
77 unsigned char ewma_log;
78};
79
80
81#endif /* __LINUX_GEN_STATS_H */