gen_stats.h 1.5 KB

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