gen_stats.h 1.5 KB

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