Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef __LINUX_GEN_STATS_H
0003 #define __LINUX_GEN_STATS_H
0004 
0005 #include <linux/types.h>
0006 
0007 enum {
0008     TCA_STATS_UNSPEC,
0009     TCA_STATS_BASIC,
0010     TCA_STATS_RATE_EST,
0011     TCA_STATS_QUEUE,
0012     TCA_STATS_APP,
0013     TCA_STATS_RATE_EST64,
0014     TCA_STATS_PAD,
0015     TCA_STATS_BASIC_HW,
0016     TCA_STATS_PKT64,
0017     __TCA_STATS_MAX,
0018 };
0019 #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
0020 
0021 /**
0022  * struct gnet_stats_basic - byte/packet throughput statistics
0023  * @bytes: number of seen bytes
0024  * @packets: number of seen packets
0025  */
0026 struct gnet_stats_basic {
0027     __u64   bytes;
0028     __u32   packets;
0029 };
0030 
0031 /**
0032  * struct gnet_stats_rate_est - rate estimator
0033  * @bps: current byte rate
0034  * @pps: current packet rate
0035  */
0036 struct gnet_stats_rate_est {
0037     __u32   bps;
0038     __u32   pps;
0039 };
0040 
0041 /**
0042  * struct gnet_stats_rate_est64 - rate estimator
0043  * @bps: current byte rate
0044  * @pps: current packet rate
0045  */
0046 struct gnet_stats_rate_est64 {
0047     __u64   bps;
0048     __u64   pps;
0049 };
0050 
0051 /**
0052  * struct gnet_stats_queue - queuing statistics
0053  * @qlen: queue length
0054  * @backlog: backlog size of queue
0055  * @drops: number of dropped packets
0056  * @requeues: number of requeues
0057  * @overlimits: number of enqueues over the limit
0058  */
0059 struct gnet_stats_queue {
0060     __u32   qlen;
0061     __u32   backlog;
0062     __u32   drops;
0063     __u32   requeues;
0064     __u32   overlimits;
0065 };
0066 
0067 /**
0068  * struct gnet_estimator - rate estimator configuration
0069  * @interval: sampling period
0070  * @ewma_log: the log of measurement window weight
0071  */
0072 struct gnet_estimator {
0073     signed char interval;
0074     unsigned char   ewma_log;
0075 };
0076 
0077 
0078 #endif /* __LINUX_GEN_STATS_H */