cdp_txrx_hist_struct.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_hist_struct.h
  20. * @brief Define the host data path histogram data types
  21. */
  22. #ifndef _CDP_TXRX_HIST_STRUCT_H_
  23. #define _CDP_TXRX_HIST_STRUCT_H_
  24. /*
  25. * cdp_hist_bucket_index : Histogram Bucket
  26. * @CDP_HIST_BUCKET_0: Bucket Index 0
  27. * @CDP_HIST_BUCKET_1: Bucket Index 1
  28. * @CDP_HIST_BUCKET_2: Bucket Index 2
  29. * @CDP_HIST_BUCKET_3: Bucket Index 3
  30. * @CDP_HIST_BUCKET_4: Bucket Index 4
  31. * @CDP_HIST_BUCKET_5: Bucket Index 5
  32. * @CDP_HIST_BUCKET_6: Bucket Index 6
  33. * @CDP_HIST_BUCKET_7: Bucket Index 7
  34. * @CDP_HIST_BUCKET_8: Bucket Index 8
  35. * @CDP_HIST_BUCKET_9: Bucket Index 9
  36. */
  37. enum cdp_hist_bucket_index {
  38. CDP_HIST_BUCKET_0,
  39. CDP_HIST_BUCKET_1,
  40. CDP_HIST_BUCKET_2,
  41. CDP_HIST_BUCKET_3,
  42. CDP_HIST_BUCKET_4,
  43. CDP_HIST_BUCKET_5,
  44. CDP_HIST_BUCKET_6,
  45. CDP_HIST_BUCKET_7,
  46. CDP_HIST_BUCKET_8,
  47. CDP_HIST_BUCKET_9,
  48. CDP_HIST_BUCKET_MAX,
  49. };
  50. /*
  51. * cdp_hist_types: Histogram Types
  52. * @CDP_HIST_TYPE_SW_ENQEUE_DELAY: From stack to HW enqueue delay
  53. * @CDP_HIST_TYPE_HW_COMP_DELAY: From HW enqueue to completion delay
  54. * @CDP_HIST_TYPE_REAP_STACK: Rx HW reap to stack deliver delay
  55. */
  56. enum cdp_hist_types {
  57. CDP_HIST_TYPE_SW_ENQEUE_DELAY,
  58. CDP_HIST_TYPE_HW_COMP_DELAY,
  59. CDP_HIST_TYPE_REAP_STACK,
  60. CDP_HIST_TYPE_MAX,
  61. };
  62. /*
  63. * cdp_hist_bucket: Histogram Bucket
  64. * @hist_type: Histogram type
  65. * @freq: Frequency
  66. */
  67. struct cdp_hist_bucket {
  68. enum cdp_hist_types hist_type;
  69. uint64_t freq[CDP_HIST_BUCKET_MAX];
  70. };
  71. /*
  72. * cdp_hist_stats : Histogram of a stats type
  73. * @hist: Frequency distribution
  74. * @max: Max frequency
  75. * @min: Minimum frequency
  76. * @avg: Average frequency
  77. */
  78. struct cdp_hist_stats {
  79. struct cdp_hist_bucket hist;
  80. int max;
  81. int min;
  82. int avg;
  83. };
  84. #endif /* _CDP_TXRX_HIST_STRUCT_H_ */