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