gen_stats.h 1.3 KB

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