0001
0002
0003 #ifndef _FNIC_STATS_H_
0004 #define _FNIC_STATS_H_
0005
0006 struct stats_timestamps {
0007 struct timespec64 last_reset_time;
0008 struct timespec64 last_read_time;
0009 };
0010
0011 struct io_path_stats {
0012 atomic64_t active_ios;
0013 atomic64_t max_active_ios;
0014 atomic64_t io_completions;
0015 atomic64_t io_failures;
0016 atomic64_t ioreq_null;
0017 atomic64_t alloc_failures;
0018 atomic64_t sc_null;
0019 atomic64_t io_not_found;
0020 atomic64_t num_ios;
0021 atomic64_t io_btw_0_to_10_msec;
0022 atomic64_t io_btw_10_to_100_msec;
0023 atomic64_t io_btw_100_to_500_msec;
0024 atomic64_t io_btw_500_to_5000_msec;
0025 atomic64_t io_btw_5000_to_10000_msec;
0026 atomic64_t io_btw_10000_to_30000_msec;
0027 atomic64_t io_greater_than_30000_msec;
0028 atomic64_t current_max_io_time;
0029 };
0030
0031 struct abort_stats {
0032 atomic64_t aborts;
0033 atomic64_t abort_failures;
0034 atomic64_t abort_drv_timeouts;
0035 atomic64_t abort_fw_timeouts;
0036 atomic64_t abort_io_not_found;
0037 atomic64_t abort_issued_btw_0_to_6_sec;
0038 atomic64_t abort_issued_btw_6_to_20_sec;
0039 atomic64_t abort_issued_btw_20_to_30_sec;
0040 atomic64_t abort_issued_btw_30_to_40_sec;
0041 atomic64_t abort_issued_btw_40_to_50_sec;
0042 atomic64_t abort_issued_btw_50_to_60_sec;
0043 atomic64_t abort_issued_greater_than_60_sec;
0044 };
0045
0046 struct terminate_stats {
0047 atomic64_t terminates;
0048 atomic64_t max_terminates;
0049 atomic64_t terminate_drv_timeouts;
0050 atomic64_t terminate_fw_timeouts;
0051 atomic64_t terminate_io_not_found;
0052 atomic64_t terminate_failures;
0053 };
0054
0055 struct reset_stats {
0056 atomic64_t device_resets;
0057 atomic64_t device_reset_failures;
0058 atomic64_t device_reset_aborts;
0059 atomic64_t device_reset_timeouts;
0060 atomic64_t device_reset_terminates;
0061 atomic64_t fw_resets;
0062 atomic64_t fw_reset_completions;
0063 atomic64_t fw_reset_failures;
0064 atomic64_t fnic_resets;
0065 atomic64_t fnic_reset_completions;
0066 atomic64_t fnic_reset_failures;
0067 };
0068
0069 struct fw_stats {
0070 atomic64_t active_fw_reqs;
0071 atomic64_t max_fw_reqs;
0072 atomic64_t fw_out_of_resources;
0073 atomic64_t io_fw_errs;
0074 };
0075
0076 struct vlan_stats {
0077 atomic64_t vlan_disc_reqs;
0078 atomic64_t resp_withno_vlanID;
0079 atomic64_t sol_expiry_count;
0080 atomic64_t flogi_rejects;
0081 };
0082
0083 struct misc_stats {
0084 u64 last_isr_time;
0085 u64 last_ack_time;
0086 atomic64_t max_isr_jiffies;
0087 atomic64_t max_isr_time_ms;
0088 atomic64_t corr_work_done;
0089 atomic64_t isr_count;
0090 atomic64_t max_cq_entries;
0091 atomic64_t ack_index_out_of_range;
0092 atomic64_t data_count_mismatch;
0093 atomic64_t fcpio_timeout;
0094 atomic64_t fcpio_aborted;
0095 atomic64_t sgl_invalid;
0096 atomic64_t mss_invalid;
0097 atomic64_t abts_cpwq_alloc_failures;
0098 atomic64_t devrst_cpwq_alloc_failures;
0099 atomic64_t io_cpwq_alloc_failures;
0100 atomic64_t no_icmnd_itmf_cmpls;
0101 atomic64_t check_condition;
0102 atomic64_t queue_fulls;
0103 atomic64_t rport_not_ready;
0104 atomic64_t frame_errors;
0105 atomic64_t current_port_speed;
0106 };
0107
0108 struct fnic_stats {
0109 struct stats_timestamps stats_timestamps;
0110 struct io_path_stats io_stats;
0111 struct abort_stats abts_stats;
0112 struct terminate_stats term_stats;
0113 struct reset_stats reset_stats;
0114 struct fw_stats fw_stats;
0115 struct vlan_stats vlan_stats;
0116 struct misc_stats misc_stats;
0117 };
0118
0119 struct stats_debug_info {
0120 char *debug_buffer;
0121 void *i_private;
0122 int buf_size;
0123 int buffer_len;
0124 };
0125
0126 int fnic_get_stats_data(struct stats_debug_info *, struct fnic_stats *);
0127 void fnic_stats_debugfs_init(struct fnic *);
0128 void fnic_stats_debugfs_remove(struct fnic *);
0129 #endif