gen_stats.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_BASIC_HW,
  14. TCA_STATS_PKT64,
  15. __TCA_STATS_MAX,
  16. };
  17. #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
  18. /**
  19. * struct gnet_stats_basic - byte/packet throughput statistics
  20. * @bytes: number of seen bytes
  21. * @packets: number of seen packets
  22. */
  23. struct gnet_stats_basic {
  24. __u64 bytes;
  25. __u32 packets;
  26. };
  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 */