Lines Matching +full:io +full:- +full:reset

1 // SPDX-License-Identifier: GPL-2.0-only
11 * snic_debugfs_init - Initialize debugfs for snic debug logging
21 snic_glob->trc_root = debugfs_create_dir("snic", NULL); in snic_debugfs_init()
23 snic_glob->stats_root = debugfs_create_dir("statistics", in snic_debugfs_init()
24 snic_glob->trc_root); in snic_debugfs_init()
28 * snic_debugfs_term - Tear down debugfs intrastructure
37 debugfs_remove(snic_glob->stats_root); in snic_debugfs_term()
38 snic_glob->stats_root = NULL; in snic_debugfs_term()
40 debugfs_remove(snic_glob->trc_root); in snic_debugfs_term()
41 snic_glob->trc_root = NULL; in snic_debugfs_term()
45 * snic_reset_stats_open - Open the reset_stats file
50 SNIC_BUG_ON(!inode->i_private); in snic_reset_stats_open()
51 filp->private_data = inode->i_private; in snic_reset_stats_open()
57 * snic_reset_stats_read - Read a reset_stats debugfs file
77 struct snic *snic = (struct snic *) filp->private_data; in snic_reset_stats_read()
81 len = sprintf(buf, "%u\n", snic->reset_stats); in snic_reset_stats_read()
87 * snic_reset_stats_write - Write to reset_stats debugfs file
106 struct snic *snic = (struct snic *) filp->private_data; in snic_reset_stats_write()
107 struct snic_stats *stats = &snic->s_stats; in snic_reset_stats_write()
108 u64 *io_stats_p = (u64 *) &stats->io; in snic_reset_stats_write()
109 u64 *fw_stats_p = (u64 *) &stats->fw; in snic_reset_stats_write()
115 return -EINVAL; in snic_reset_stats_write()
118 return -EFAULT; in snic_reset_stats_write()
126 snic->reset_stats = val; in snic_reset_stats_write()
128 if (snic->reset_stats) { in snic_reset_stats_write()
130 * and IO Completions stats. Skip incrementing No IO Compls in snic_reset_stats_write()
133 atomic64_set(&snic->io_cmpl_skip, in snic_reset_stats_write()
134 atomic64_read(&stats->io.active)); in snic_reset_stats_write()
135 memset(&stats->abts, 0, sizeof(struct snic_abort_stats)); in snic_reset_stats_write()
136 memset(&stats->reset, 0, sizeof(struct snic_reset_stats)); in snic_reset_stats_write()
137 memset(&stats->misc, 0, sizeof(struct snic_misc_stats)); in snic_reset_stats_write()
140 sizeof(struct snic_io_stats) - sizeof(u64)); in snic_reset_stats_write()
143 sizeof(struct snic_fw_stats) - sizeof(u64)); in snic_reset_stats_write()
148 SNIC_HOST_INFO(snic->shost, "Reset Op: Driver statistics.\n"); in snic_reset_stats_write()
156 filp->private_data = NULL; in snic_reset_stats_release()
162 * snic_stats_show - Formats and prints per host specific driver stats.
167 struct snic *snic = (struct snic *) sfp->private; in snic_stats_show()
168 struct snic_stats *stats = &snic->s_stats; in snic_stats_show()
173 /* Dump IO Stats */ in snic_stats_show()
175 "------------------------------------------\n" in snic_stats_show()
176 "\t\t IO Statistics\n" in snic_stats_show()
177 "------------------------------------------\n"); in snic_stats_show()
179 maxio_tm = (u64) atomic64_read(&stats->io.max_time); in snic_stats_show()
190 "Max SGL for any IO : %lld\n" in snic_stats_show()
191 "Max IO Size : %lld Sectors\n" in snic_stats_show()
194 "Max IO Process Time(FW) : %lld (%u msec)\n", in snic_stats_show()
195 (u64) atomic64_read(&stats->io.active), in snic_stats_show()
196 (u64) atomic64_read(&stats->io.max_active), in snic_stats_show()
197 (u64) atomic64_read(&stats->io.num_ios), in snic_stats_show()
198 (u64) atomic64_read(&stats->io.compl), in snic_stats_show()
199 (u64) atomic64_read(&stats->io.fail), in snic_stats_show()
200 (u64) atomic64_read(&stats->io.io_not_found), in snic_stats_show()
201 (u64) atomic64_read(&stats->io.alloc_fail), in snic_stats_show()
202 (u64) atomic64_read(&stats->io.req_null), in snic_stats_show()
203 (u64) atomic64_read(&stats->io.sc_null), in snic_stats_show()
204 (u64) atomic64_read(&stats->io.max_sgl), in snic_stats_show()
205 (u64) atomic64_read(&stats->io.max_io_sz), in snic_stats_show()
206 (u64) atomic64_read(&stats->io.max_qtime), in snic_stats_show()
207 (u64) atomic64_read(&stats->io.max_cmpl_time), in snic_stats_show()
216 (u64) atomic64_read(&stats->io.sgl_cnt[i])); in snic_stats_show()
224 "\n-------------------------------------------\n" in snic_stats_show()
226 "---------------------------------------------\n"); in snic_stats_show()
233 "Abort IO NOT Found : %lld\n" in snic_stats_show()
235 (u64) atomic64_read(&stats->abts.num), in snic_stats_show()
236 (u64) atomic64_read(&stats->abts.fail), in snic_stats_show()
237 (u64) atomic64_read(&stats->abts.drv_tmo), in snic_stats_show()
238 (u64) atomic64_read(&stats->abts.fw_tmo), in snic_stats_show()
239 (u64) atomic64_read(&stats->abts.io_not_found), in snic_stats_show()
240 (u64) atomic64_read(&stats->abts.q_fail)); in snic_stats_show()
242 /* Dump Reset Stats */ in snic_stats_show()
244 "\n-------------------------------------------\n" in snic_stats_show()
245 "\t\t Reset Statistics\n" in snic_stats_show()
246 "---------------------------------------------\n"); in snic_stats_show()
250 "HBA Reset Cmpls : %lld\n" in snic_stats_show()
251 "HBA Reset Fail : %lld\n", in snic_stats_show()
252 (u64) atomic64_read(&stats->reset.hba_resets), in snic_stats_show()
253 (u64) atomic64_read(&stats->reset.hba_reset_cmpl), in snic_stats_show()
254 (u64) atomic64_read(&stats->reset.hba_reset_fail)); in snic_stats_show()
258 "\n-------------------------------------------\n" in snic_stats_show()
260 "---------------------------------------------\n"); in snic_stats_show()
266 "FW IO Errors : %lld\n" in snic_stats_show()
268 (u64) atomic64_read(&stats->fw.actv_reqs), in snic_stats_show()
269 (u64) atomic64_read(&stats->fw.max_actv_reqs), in snic_stats_show()
270 (u64) atomic64_read(&stats->fw.out_of_res), in snic_stats_show()
271 (u64) atomic64_read(&stats->fw.io_errs), in snic_stats_show()
272 (u64) atomic64_read(&stats->fw.scsi_errs)); in snic_stats_show()
277 "\n---------------------------------------------\n" in snic_stats_show()
279 "\n---------------------------------------------\n"); in snic_stats_show()
281 jiffies_to_timespec64(stats->misc.last_isr_time, &last_isr_tms); in snic_stats_show()
282 jiffies_to_timespec64(stats->misc.last_ack_time, &last_ack_tms); in snic_stats_show()
288 "IO Cmpl ISRs : %llu\n" in snic_stats_show()
301 (u64) stats->misc.last_isr_time, in snic_stats_show()
303 (u64)stats->misc.last_ack_time, in snic_stats_show()
305 (u64) atomic64_read(&stats->misc.ack_isr_cnt), in snic_stats_show()
306 (u64) atomic64_read(&stats->misc.cmpl_isr_cnt), in snic_stats_show()
307 (u64) atomic64_read(&stats->misc.errnotify_isr_cnt), in snic_stats_show()
308 (u64) atomic64_read(&stats->misc.max_cq_ents), in snic_stats_show()
309 (u64) atomic64_read(&stats->misc.data_cnt_mismat), in snic_stats_show()
310 (u64) atomic64_read(&stats->misc.io_tmo), in snic_stats_show()
311 (u64) atomic64_read(&stats->misc.io_aborted), in snic_stats_show()
312 (u64) atomic64_read(&stats->misc.sgl_inval), in snic_stats_show()
313 (u64) atomic64_read(&stats->misc.wq_alloc_fail), in snic_stats_show()
314 (u64) atomic64_read(&stats->misc.qfull), in snic_stats_show()
315 (u64) atomic64_read(&stats->misc.qsz_rampup), in snic_stats_show()
316 (u64) atomic64_read(&stats->misc.qsz_rampdown), in snic_stats_show()
317 (u64) atomic64_read(&stats->misc.last_qsz), in snic_stats_show()
318 (u64) atomic64_read(&stats->misc.tgt_not_rdy)); in snic_stats_show()
334 * snic_stats_init - Initialize stats struct and create stats file
346 snprintf(name, sizeof(name), "host%d", snic->shost->host_no); in snic_stats_debugfs_init()
348 snic->stats_host = debugfs_create_dir(name, snic_glob->stats_root); in snic_stats_debugfs_init()
350 snic->stats_file = debugfs_create_file("stats", S_IFREG|S_IRUGO, in snic_stats_debugfs_init()
351 snic->stats_host, snic, in snic_stats_debugfs_init()
354 snic->reset_stats_file = debugfs_create_file("reset_stats", in snic_stats_debugfs_init()
356 snic->stats_host, snic, in snic_stats_debugfs_init()
361 * snic_stats_debugfs_remove - Tear down debugfs infrastructure of stats
370 debugfs_remove(snic->stats_file); in snic_stats_debugfs_remove()
371 snic->stats_file = NULL; in snic_stats_debugfs_remove()
373 debugfs_remove(snic->reset_stats_file); in snic_stats_debugfs_remove()
374 snic->reset_stats_file = NULL; in snic_stats_debugfs_remove()
376 debugfs_remove(snic->stats_host); in snic_stats_debugfs_remove()
377 snic->stats_host = NULL; in snic_stats_debugfs_remove()
384 return &snic_glob->trc; in snic_trc_seq_start()
428 snic_glob->trc_root, &snic_glob->trc.enable); in snic_trc_debugfs_init()
431 snic_glob->trc_root, NULL, &snic_trc_fops); in snic_trc_debugfs_init()
440 debugfs_lookup_and_remove(TRC_FILE, snic_glob->trc_root); in snic_trc_debugfs_term()
441 debugfs_lookup_and_remove(TRC_ENABLE_FILE, snic_glob->trc_root); in snic_trc_debugfs_term()