fnic_stats.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * Copyright 2013 Cisco Systems, Inc. All rights reserved.
  3. *
  4. * This program is free software; you may redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; version 2 of the License.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  9. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  11. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  12. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  13. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  14. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  15. * SOFTWARE.
  16. */
  17. #ifndef _FNIC_STATS_H_
  18. #define _FNIC_STATS_H_
  19. struct stats_timestamps {
  20. struct timespec64 last_reset_time;
  21. struct timespec64 last_read_time;
  22. };
  23. struct io_path_stats {
  24. atomic64_t active_ios;
  25. atomic64_t max_active_ios;
  26. atomic64_t io_completions;
  27. atomic64_t io_failures;
  28. atomic64_t ioreq_null;
  29. atomic64_t alloc_failures;
  30. atomic64_t sc_null;
  31. atomic64_t io_not_found;
  32. atomic64_t num_ios;
  33. atomic64_t io_btw_0_to_10_msec;
  34. atomic64_t io_btw_10_to_100_msec;
  35. atomic64_t io_btw_100_to_500_msec;
  36. atomic64_t io_btw_500_to_5000_msec;
  37. atomic64_t io_btw_5000_to_10000_msec;
  38. atomic64_t io_btw_10000_to_30000_msec;
  39. atomic64_t io_greater_than_30000_msec;
  40. atomic64_t current_max_io_time;
  41. };
  42. struct abort_stats {
  43. atomic64_t aborts;
  44. atomic64_t abort_failures;
  45. atomic64_t abort_drv_timeouts;
  46. atomic64_t abort_fw_timeouts;
  47. atomic64_t abort_io_not_found;
  48. atomic64_t abort_issued_btw_0_to_6_sec;
  49. atomic64_t abort_issued_btw_6_to_20_sec;
  50. atomic64_t abort_issued_btw_20_to_30_sec;
  51. atomic64_t abort_issued_btw_30_to_40_sec;
  52. atomic64_t abort_issued_btw_40_to_50_sec;
  53. atomic64_t abort_issued_btw_50_to_60_sec;
  54. atomic64_t abort_issued_greater_than_60_sec;
  55. };
  56. struct terminate_stats {
  57. atomic64_t terminates;
  58. atomic64_t max_terminates;
  59. atomic64_t terminate_drv_timeouts;
  60. atomic64_t terminate_fw_timeouts;
  61. atomic64_t terminate_io_not_found;
  62. atomic64_t terminate_failures;
  63. };
  64. struct reset_stats {
  65. atomic64_t device_resets;
  66. atomic64_t device_reset_failures;
  67. atomic64_t device_reset_aborts;
  68. atomic64_t device_reset_timeouts;
  69. atomic64_t device_reset_terminates;
  70. atomic64_t fw_resets;
  71. atomic64_t fw_reset_completions;
  72. atomic64_t fw_reset_failures;
  73. atomic64_t fnic_resets;
  74. atomic64_t fnic_reset_completions;
  75. atomic64_t fnic_reset_failures;
  76. };
  77. struct fw_stats {
  78. atomic64_t active_fw_reqs;
  79. atomic64_t max_fw_reqs;
  80. atomic64_t fw_out_of_resources;
  81. atomic64_t io_fw_errs;
  82. };
  83. struct vlan_stats {
  84. atomic64_t vlan_disc_reqs;
  85. atomic64_t resp_withno_vlanID;
  86. atomic64_t sol_expiry_count;
  87. atomic64_t flogi_rejects;
  88. };
  89. struct misc_stats {
  90. u64 last_isr_time;
  91. u64 last_ack_time;
  92. atomic64_t isr_count;
  93. atomic64_t max_cq_entries;
  94. atomic64_t ack_index_out_of_range;
  95. atomic64_t data_count_mismatch;
  96. atomic64_t fcpio_timeout;
  97. atomic64_t fcpio_aborted;
  98. atomic64_t sgl_invalid;
  99. atomic64_t mss_invalid;
  100. atomic64_t abts_cpwq_alloc_failures;
  101. atomic64_t devrst_cpwq_alloc_failures;
  102. atomic64_t io_cpwq_alloc_failures;
  103. atomic64_t no_icmnd_itmf_cmpls;
  104. atomic64_t check_condition;
  105. atomic64_t queue_fulls;
  106. atomic64_t rport_not_ready;
  107. atomic64_t frame_errors;
  108. };
  109. struct fnic_stats {
  110. struct stats_timestamps stats_timestamps;
  111. struct io_path_stats io_stats;
  112. struct abort_stats abts_stats;
  113. struct terminate_stats term_stats;
  114. struct reset_stats reset_stats;
  115. struct fw_stats fw_stats;
  116. struct vlan_stats vlan_stats;
  117. struct misc_stats misc_stats;
  118. };
  119. struct stats_debug_info {
  120. char *debug_buffer;
  121. void *i_private;
  122. int buf_size;
  123. int buffer_len;
  124. };
  125. int fnic_get_stats_data(struct stats_debug_info *, struct fnic_stats *);
  126. int fnic_stats_debugfs_init(struct fnic *);
  127. void fnic_stats_debugfs_remove(struct fnic *);
  128. #endif /* _FNIC_STATS_H_ */