gen_stats.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. /**
  24. * struct gnet_stats_rate_est - rate estimator
  25. * @bps: current byte rate
  26. * @pps: current packet rate
  27. */
  28. struct gnet_stats_rate_est
  29. {
  30. __u32 bps;
  31. __u32 pps;
  32. };
  33. /**
  34. * struct gnet_stats_queue - queuing statistics
  35. * @qlen: queue length
  36. * @backlog: backlog size of queue
  37. * @drops: number of dropped packets
  38. * @requeues: number of requeues
  39. * @overlimits: number of enqueues over the limit
  40. */
  41. struct gnet_stats_queue
  42. {
  43. __u32 qlen;
  44. __u32 backlog;
  45. __u32 drops;
  46. __u32 requeues;
  47. __u32 overlimits;
  48. };
  49. /**
  50. * struct gnet_estimator - rate estimator configuration
  51. * @interval: sampling period
  52. * @ewma_log: the log of measurement window weight
  53. */
  54. struct gnet_estimator
  55. {
  56. signed char interval;
  57. unsigned char ewma_log;
  58. };
  59. #endif /* __LINUX_GEN_STATS_H */