1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef __LINUX_GEN_STATS_H 3607ca46eSDavid Howells #define __LINUX_GEN_STATS_H 4607ca46eSDavid Howells 5607ca46eSDavid Howells #include <linux/types.h> 6607ca46eSDavid Howells 7607ca46eSDavid Howells enum { 8607ca46eSDavid Howells TCA_STATS_UNSPEC, 9607ca46eSDavid Howells TCA_STATS_BASIC, 10607ca46eSDavid Howells TCA_STATS_RATE_EST, 11607ca46eSDavid Howells TCA_STATS_QUEUE, 12607ca46eSDavid Howells TCA_STATS_APP, 1345203a3bSEric Dumazet TCA_STATS_RATE_EST64, 149854518eSNicolas Dichtel TCA_STATS_PAD, 15607ca46eSDavid Howells __TCA_STATS_MAX, 16607ca46eSDavid Howells }; 17607ca46eSDavid Howells #define TCA_STATS_MAX (__TCA_STATS_MAX - 1) 18607ca46eSDavid Howells 19607ca46eSDavid Howells /** 20607ca46eSDavid Howells * struct gnet_stats_basic - byte/packet throughput statistics 21607ca46eSDavid Howells * @bytes: number of seen bytes 22607ca46eSDavid Howells * @packets: number of seen packets 23607ca46eSDavid Howells */ 24607ca46eSDavid Howells struct gnet_stats_basic { 25607ca46eSDavid Howells __u64 bytes; 26607ca46eSDavid Howells __u32 packets; 27607ca46eSDavid Howells }; 28607ca46eSDavid Howells struct gnet_stats_basic_packed { 29607ca46eSDavid Howells __u64 bytes; 30607ca46eSDavid Howells __u32 packets; 31607ca46eSDavid Howells } __attribute__ ((packed)); 32607ca46eSDavid Howells 33607ca46eSDavid Howells /** 34607ca46eSDavid Howells * struct gnet_stats_rate_est - rate estimator 35607ca46eSDavid Howells * @bps: current byte rate 36607ca46eSDavid Howells * @pps: current packet rate 37607ca46eSDavid Howells */ 38607ca46eSDavid Howells struct gnet_stats_rate_est { 39607ca46eSDavid Howells __u32 bps; 40607ca46eSDavid Howells __u32 pps; 41607ca46eSDavid Howells }; 42607ca46eSDavid Howells 43607ca46eSDavid Howells /** 4445203a3bSEric Dumazet * struct gnet_stats_rate_est64 - rate estimator 4545203a3bSEric Dumazet * @bps: current byte rate 4645203a3bSEric Dumazet * @pps: current packet rate 4745203a3bSEric Dumazet */ 4845203a3bSEric Dumazet struct gnet_stats_rate_est64 { 4945203a3bSEric Dumazet __u64 bps; 5045203a3bSEric Dumazet __u64 pps; 5145203a3bSEric Dumazet }; 5245203a3bSEric Dumazet 5345203a3bSEric Dumazet /** 54607ca46eSDavid Howells * struct gnet_stats_queue - queuing statistics 55607ca46eSDavid Howells * @qlen: queue length 56607ca46eSDavid Howells * @backlog: backlog size of queue 57607ca46eSDavid Howells * @drops: number of dropped packets 58607ca46eSDavid Howells * @requeues: number of requeues 59607ca46eSDavid Howells * @overlimits: number of enqueues over the limit 60607ca46eSDavid Howells */ 61607ca46eSDavid Howells struct gnet_stats_queue { 62607ca46eSDavid Howells __u32 qlen; 63607ca46eSDavid Howells __u32 backlog; 64607ca46eSDavid Howells __u32 drops; 65607ca46eSDavid Howells __u32 requeues; 66607ca46eSDavid Howells __u32 overlimits; 67607ca46eSDavid Howells }; 68607ca46eSDavid Howells 69607ca46eSDavid Howells /** 70607ca46eSDavid Howells * struct gnet_estimator - rate estimator configuration 71607ca46eSDavid Howells * @interval: sampling period 72607ca46eSDavid Howells * @ewma_log: the log of measurement window weight 73607ca46eSDavid Howells */ 74607ca46eSDavid Howells struct gnet_estimator { 75607ca46eSDavid Howells signed char interval; 76607ca46eSDavid Howells unsigned char ewma_log; 77607ca46eSDavid Howells }; 78607ca46eSDavid Howells 79607ca46eSDavid Howells 80607ca46eSDavid Howells #endif /* __LINUX_GEN_STATS_H */ 81