gen_stats.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_MAX,
  11. };
  12. #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
  13. /**
  14. * struct gnet_stats_basic - byte/packet throughput statistics
  15. * @bytes: number of seen bytes
  16. * @packets: number of seen packets
  17. */
  18. struct gnet_stats_basic
  19. {
  20. __u64 bytes;
  21. __u32 packets;
  22. };
  23. struct gnet_stats_basic_packed
  24. {
  25. __u64 bytes;
  26. __u32 packets;
  27. } __attribute__ ((packed));
  28. /**
  29. * struct gnet_stats_rate_est - rate estimator
  30. * @bps: current byte rate
  31. * @pps: current packet rate
  32. */
  33. struct gnet_stats_rate_est
  34. {
  35. __u32 bps;
  36. __u32 pps;
  37. };
  38. /**
  39. * struct gnet_stats_queue - queuing statistics
  40. * @qlen: queue length
  41. * @backlog: backlog size of queue
  42. * @drops: number of dropped packets
  43. * @requeues: number of requeues
  44. * @overlimits: number of enqueues over the limit
  45. */
  46. struct gnet_stats_queue
  47. {
  48. __u32 qlen;
  49. __u32 backlog;
  50. __u32 drops;
  51. __u32 requeues;
  52. __u32 overlimits;
  53. };
  54. /**
  55. * struct gnet_estimator - rate estimator configuration
  56. * @interval: sampling period
  57. * @ewma_log: the log of measurement window weight
  58. */
  59. struct gnet_estimator
  60. {
  61. signed char interval;
  62. unsigned char ewma_log;
  63. };
  64. #endif /* __LINUX_GEN_STATS_H */