Home | History | Annotate | Download | only in linux
      1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
      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,
     13 	TCA_STATS_RATE_EST64,
     14 	TCA_STATS_PAD,
     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  */
     24 struct gnet_stats_basic {
     25 	__u64	bytes;
     26 	__u32	packets;
     27 };
     28 struct gnet_stats_basic_packed {
     29 	__u64	bytes;
     30 	__u32	packets;
     31 } __attribute__ ((packed));
     32 
     33 /**
     34  * struct gnet_stats_rate_est - rate estimator
     35  * @bps: current byte rate
     36  * @pps: current packet rate
     37  */
     38 struct gnet_stats_rate_est {
     39 	__u32	bps;
     40 	__u32	pps;
     41 };
     42 
     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 
     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  */
     61 struct gnet_stats_queue {
     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  */
     74 struct gnet_estimator {
     75 	signed char	interval;
     76 	unsigned char	ewma_log;
     77 };
     78 
     79 
     80 #endif /* __LINUX_GEN_STATS_H */
     81