fnic_stats.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 io_path_stats {
  20. atomic64_t active_ios;
  21. atomic64_t max_active_ios;
  22. atomic64_t io_completions;
  23. atomic64_t io_failures;
  24. atomic64_t ioreq_null;
  25. atomic64_t alloc_failures;
  26. atomic64_t sc_null;
  27. atomic64_t io_not_found;
  28. atomic64_t num_ios;
  29. };
  30. struct abort_stats {
  31. atomic64_t aborts;
  32. atomic64_t abort_failures;
  33. atomic64_t abort_drv_timeouts;
  34. atomic64_t abort_fw_timeouts;
  35. atomic64_t abort_io_not_found;
  36. };
  37. struct terminate_stats {
  38. atomic64_t terminates;
  39. atomic64_t max_terminates;
  40. atomic64_t terminate_drv_timeouts;
  41. atomic64_t terminate_fw_timeouts;
  42. atomic64_t terminate_io_not_found;
  43. atomic64_t terminate_failures;
  44. };
  45. struct reset_stats {
  46. atomic64_t device_resets;
  47. atomic64_t device_reset_failures;
  48. atomic64_t device_reset_aborts;
  49. atomic64_t device_reset_timeouts;
  50. atomic64_t device_reset_terminates;
  51. atomic64_t fw_resets;
  52. atomic64_t fw_reset_completions;
  53. atomic64_t fw_reset_failures;
  54. atomic64_t fnic_resets;
  55. atomic64_t fnic_reset_completions;
  56. atomic64_t fnic_reset_failures;
  57. };
  58. struct fw_stats {
  59. atomic64_t active_fw_reqs;
  60. atomic64_t max_fw_reqs;
  61. atomic64_t fw_out_of_resources;
  62. atomic64_t io_fw_errs;
  63. };
  64. struct vlan_stats {
  65. atomic64_t vlan_disc_reqs;
  66. atomic64_t resp_withno_vlanID;
  67. atomic64_t sol_expiry_count;
  68. atomic64_t flogi_rejects;
  69. };
  70. struct misc_stats {
  71. u64 last_isr_time;
  72. u64 last_ack_time;
  73. atomic64_t isr_count;
  74. atomic64_t max_cq_entries;
  75. atomic64_t ack_index_out_of_range;
  76. atomic64_t data_count_mismatch;
  77. atomic64_t fcpio_timeout;
  78. atomic64_t fcpio_aborted;
  79. atomic64_t sgl_invalid;
  80. atomic64_t mss_invalid;
  81. atomic64_t abts_cpwq_alloc_failures;
  82. atomic64_t devrst_cpwq_alloc_failures;
  83. atomic64_t io_cpwq_alloc_failures;
  84. atomic64_t no_icmnd_itmf_cmpls;
  85. atomic64_t queue_fulls;
  86. atomic64_t rport_not_ready;
  87. atomic64_t frame_errors;
  88. };
  89. struct fnic_stats {
  90. struct io_path_stats io_stats;
  91. struct abort_stats abts_stats;
  92. struct terminate_stats term_stats;
  93. struct reset_stats reset_stats;
  94. struct fw_stats fw_stats;
  95. struct vlan_stats vlan_stats;
  96. struct misc_stats misc_stats;
  97. };
  98. struct stats_debug_info {
  99. char *debug_buffer;
  100. void *i_private;
  101. int buf_size;
  102. int buffer_len;
  103. };
  104. int fnic_get_stats_data(struct stats_debug_info *, struct fnic_stats *);
  105. int fnic_stats_debugfs_init(struct fnic *);
  106. void fnic_stats_debugfs_remove(struct fnic *);
  107. #endif /* _FNIC_STATS_H_ */