gen_stats.h 1.5 KB

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