| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* Copyright 2013 Cisco Systems, Inc. All rights reserved. */ |
| 3 |
#ifndef _FNIC_STATS_H_ |
| 4 |
#define _FNIC_STATS_H_ |
| 5 |
#define FNIC_MQ_MAX_QUEUES 64 |
| 6 |
#include <scsi/scsi_transport_fc.h> |
| 7 |
|
| 8 |
struct stats_timestamps { |
| 9 |
struct timespec64 last_reset_time; |
| 10 |
struct timespec64 last_read_time; |
| 11 |
}; |
| 12 |
|
| 13 |
struct io_path_stats { |
| 14 |
atomic64_t active_ios; |
| 15 |
atomic64_t max_active_ios; |
| 16 |
atomic64_t io_completions; |
| 17 |
atomic64_t io_failures; |
| 18 |
atomic64_t ioreq_null; |
| 19 |
atomic64_t alloc_failures; |
| 20 |
atomic64_t sc_null; |
| 21 |
atomic64_t io_not_found; |
| 22 |
atomic64_t num_ios; |
| 23 |
atomic64_t io_btw_0_to_10_msec; |
| 24 |
atomic64_t io_btw_10_to_100_msec; |
| 25 |
atomic64_t io_btw_100_to_500_msec; |
| 26 |
atomic64_t io_btw_500_to_5000_msec; |
| 27 |
atomic64_t io_btw_5000_to_10000_msec; |
| 28 |
atomic64_t io_btw_10000_to_30000_msec; |
| 29 |
atomic64_t io_greater_than_30000_msec; |
| 30 |
atomic64_t current_max_io_time; |
| 31 |
atomic64_t ios[FNIC_MQ_MAX_QUEUES]; |
| 32 |
}; |
| 33 |
|
| 34 |
struct abort_stats { |
| 35 |
atomic64_t aborts; |
| 36 |
atomic64_t abort_failures; |
| 37 |
atomic64_t abort_drv_timeouts; |
| 38 |
atomic64_t abort_fw_timeouts; |
| 39 |
atomic64_t abort_io_not_found; |
| 40 |
atomic64_t abort_issued_btw_0_to_6_sec; |
| 41 |
atomic64_t abort_issued_btw_6_to_20_sec; |
| 42 |
atomic64_t abort_issued_btw_20_to_30_sec; |
| 43 |
atomic64_t abort_issued_btw_30_to_40_sec; |
| 44 |
atomic64_t abort_issued_btw_40_to_50_sec; |
| 45 |
atomic64_t abort_issued_btw_50_to_60_sec; |
| 46 |
atomic64_t abort_issued_greater_than_60_sec; |
| 47 |
}; |
| 48 |
|
| 49 |
struct terminate_stats { |
| 50 |
atomic64_t terminates; |
| 51 |
atomic64_t max_terminates; |
| 52 |
atomic64_t terminate_drv_timeouts; |
| 53 |
atomic64_t terminate_fw_timeouts; |
| 54 |
atomic64_t terminate_io_not_found; |
| 55 |
atomic64_t terminate_failures; |
| 56 |
}; |
| 57 |
|
| 58 |
struct reset_stats { |
| 59 |
atomic64_t device_resets; |
| 60 |
atomic64_t device_reset_failures; |
| 61 |
atomic64_t device_reset_aborts; |
| 62 |
atomic64_t device_reset_timeouts; |
| 63 |
atomic64_t device_reset_terminates; |
| 64 |
atomic64_t fw_resets; |
| 65 |
atomic64_t fw_reset_completions; |
| 66 |
atomic64_t fw_reset_failures; |
| 67 |
atomic64_t fw_reset_timeouts; |
| 68 |
atomic64_t fnic_resets; |
| 69 |
atomic64_t fnic_reset_completions; |
| 70 |
atomic64_t fnic_reset_failures; |
| 71 |
}; |
| 72 |
|
| 73 |
struct fw_stats { |
| 74 |
atomic64_t active_fw_reqs; |
| 75 |
atomic64_t max_fw_reqs; |
| 76 |
atomic64_t fw_out_of_resources; |
| 77 |
atomic64_t io_fw_errs; |
| 78 |
}; |
| 79 |
|
| 80 |
struct vlan_stats { |
| 81 |
atomic64_t vlan_disc_reqs; |
| 82 |
atomic64_t resp_withno_vlanID; |
| 83 |
atomic64_t sol_expiry_count; |
| 84 |
atomic64_t flogi_rejects; |
| 85 |
}; |
| 86 |
|
| 87 |
struct misc_stats { |
| 88 |
u64 last_isr_time; |
| 89 |
u64 last_ack_time; |
| 90 |
atomic64_t max_isr_jiffies; |
| 91 |
atomic64_t max_isr_time_ms; |
| 92 |
atomic64_t corr_work_done; |
| 93 |
atomic64_t isr_count; |
| 94 |
atomic64_t max_cq_entries; |
| 95 |
atomic64_t ack_index_out_of_range; |
| 96 |
atomic64_t data_count_mismatch; |
| 97 |
atomic64_t fcpio_timeout; |
| 98 |
atomic64_t fcpio_aborted; |
| 99 |
atomic64_t sgl_invalid; |
| 100 |
atomic64_t mss_invalid; |
| 101 |
atomic64_t abts_cpwq_alloc_failures; |
| 102 |
atomic64_t devrst_cpwq_alloc_failures; |
| 103 |
atomic64_t io_cpwq_alloc_failures; |
| 104 |
atomic64_t no_icmnd_itmf_cmpls; |
| 105 |
atomic64_t check_condition; |
| 106 |
atomic64_t queue_fulls; |
| 107 |
atomic64_t tport_not_ready; |
| 108 |
atomic64_t iport_not_ready; |
| 109 |
atomic64_t frame_errors; |
| 110 |
atomic64_t current_port_speed; |
| 111 |
atomic64_t intx_dummy; |
| 112 |
atomic64_t port_speed_in_mbps; |
| 113 |
}; |
| 114 |
|
| 115 |
struct fnic_iport_stats { |
| 116 |
atomic64_t num_linkdn; |
| 117 |
atomic64_t num_linkup; |
| 118 |
atomic64_t link_failure_count; |
| 119 |
atomic64_t num_rscns; |
| 120 |
atomic64_t rscn_redisc; |
| 121 |
atomic64_t rscn_not_redisc; |
| 122 |
atomic64_t frame_err; |
| 123 |
atomic64_t num_rnid; |
| 124 |
atomic64_t fabric_flogi_sent; |
| 125 |
atomic64_t fabric_flogi_ls_accepts; |
| 126 |
atomic64_t fabric_flogi_ls_rejects; |
| 127 |
atomic64_t fabric_flogi_misc_rejects; |
| 128 |
atomic64_t fabric_plogi_sent; |
| 129 |
atomic64_t fabric_plogi_ls_accepts; |
| 130 |
atomic64_t fabric_plogi_ls_rejects; |
| 131 |
atomic64_t fabric_plogi_misc_rejects; |
| 132 |
atomic64_t fabric_scr_sent; |
| 133 |
atomic64_t fabric_scr_ls_accepts; |
| 134 |
atomic64_t fabric_scr_ls_rejects; |
| 135 |
atomic64_t fabric_scr_misc_rejects; |
| 136 |
atomic64_t fabric_logo_sent; |
| 137 |
atomic64_t tport_alive; |
| 138 |
atomic64_t tport_plogi_sent; |
| 139 |
atomic64_t tport_plogi_ls_accepts; |
| 140 |
atomic64_t tport_plogi_ls_rejects; |
| 141 |
atomic64_t tport_plogi_misc_rejects; |
| 142 |
atomic64_t tport_prli_sent; |
| 143 |
atomic64_t tport_prli_ls_accepts; |
| 144 |
atomic64_t tport_prli_ls_rejects; |
| 145 |
atomic64_t tport_prli_misc_rejects; |
| 146 |
atomic64_t tport_adisc_sent; |
| 147 |
atomic64_t tport_adisc_ls_accepts; |
| 148 |
atomic64_t tport_adisc_ls_rejects; |
| 149 |
atomic64_t tport_logo_sent; |
| 150 |
atomic64_t unsupported_frames_ls_rejects; |
| 151 |
atomic64_t unsupported_frames_dropped; |
| 152 |
}; |
| 153 |
|
| 154 |
struct fnic_stats { |
| 155 |
struct stats_timestamps stats_timestamps; |
| 156 |
struct io_path_stats io_stats; |
| 157 |
struct abort_stats abts_stats; |
| 158 |
struct terminate_stats term_stats; |
| 159 |
struct reset_stats reset_stats; |
| 160 |
struct fw_stats fw_stats; |
| 161 |
struct vlan_stats vlan_stats; |
| 162 |
struct fc_host_statistics host_stats; |
| 163 |
struct misc_stats misc_stats; |
| 164 |
}; |
| 165 |
|
| 166 |
struct stats_debug_info { |
| 167 |
char *debug_buffer; |
| 168 |
void *i_private; |
| 169 |
int buf_size; |
| 170 |
int buffer_len; |
| 171 |
}; |
| 172 |
|
| 173 |
int fnic_get_stats_data(struct stats_debug_info *, struct fnic_stats *); |
| 174 |
const char *fnic_role_to_str(unsigned int role); |
| 175 |
#endif /* _FNIC_STATS_H_ */ |