Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / scsi / fnic / fnic_debugfs.c
blob6c049360f136b6a842e7ec94527a5a209bfe7bc1
1 /*
2 * Copyright 2012 Cisco Systems, Inc. All rights reserved.
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.
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.
18 #include <linux/module.h>
19 #include <linux/errno.h>
20 #include <linux/debugfs.h>
21 #include <linux/vmalloc.h>
22 #include "fnic.h"
24 static struct dentry *fnic_trace_debugfs_root;
25 static struct dentry *fnic_trace_debugfs_file;
26 static struct dentry *fnic_trace_enable;
27 static struct dentry *fnic_stats_debugfs_root;
29 static struct dentry *fnic_fc_trace_debugfs_file;
30 static struct dentry *fnic_fc_rdata_trace_debugfs_file;
31 static struct dentry *fnic_fc_trace_enable;
32 static struct dentry *fnic_fc_trace_clear;
34 struct fc_trace_flag_type {
35 u8 fc_row_file;
36 u8 fc_normal_file;
37 u8 fnic_trace;
38 u8 fc_trace;
39 u8 fc_clear;
42 static struct fc_trace_flag_type *fc_trc_flag;
45 * fnic_debugfs_init - Initialize debugfs for fnic debug logging
47 * Description:
48 * When Debugfs is configured this routine sets up the fnic debugfs
49 * file system. If not already created, this routine will create the
50 * fnic directory and statistics directory for trace buffer and
51 * stats logging.
53 int fnic_debugfs_init(void)
55 fnic_trace_debugfs_root = debugfs_create_dir("fnic", NULL);
57 fnic_stats_debugfs_root = debugfs_create_dir("statistics",
58 fnic_trace_debugfs_root);
60 /* Allocate memory to structure */
61 fc_trc_flag = (struct fc_trace_flag_type *)
62 vmalloc(sizeof(struct fc_trace_flag_type));
64 if (fc_trc_flag) {
65 fc_trc_flag->fc_row_file = 0;
66 fc_trc_flag->fc_normal_file = 1;
67 fc_trc_flag->fnic_trace = 2;
68 fc_trc_flag->fc_trace = 3;
69 fc_trc_flag->fc_clear = 4;
72 return 0;
76 * fnic_debugfs_terminate - Tear down debugfs infrastructure
78 * Description:
79 * When Debugfs is configured this routine removes debugfs file system
80 * elements that are specific to fnic.
82 void fnic_debugfs_terminate(void)
84 debugfs_remove(fnic_stats_debugfs_root);
85 fnic_stats_debugfs_root = NULL;
87 debugfs_remove(fnic_trace_debugfs_root);
88 fnic_trace_debugfs_root = NULL;
90 if (fc_trc_flag)
91 vfree(fc_trc_flag);
95 * fnic_trace_ctrl_read -
96 * Read trace_enable ,fc_trace_enable
97 * or fc_trace_clear debugfs file
98 * @filp: The file pointer to read from.
99 * @ubuf: The buffer to copy the data to.
100 * @cnt: The number of bytes to read.
101 * @ppos: The position in the file to start reading from.
103 * Description:
104 * This routine reads value of variable fnic_tracing_enabled or
105 * fnic_fc_tracing_enabled or fnic_fc_trace_cleared
106 * and stores into local @buf.
107 * It will start reading file at @ppos and
108 * copy up to @cnt of data to @ubuf from @buf.
110 * Returns:
111 * This function returns the amount of data that was read.
113 static ssize_t fnic_trace_ctrl_read(struct file *filp,
114 char __user *ubuf,
115 size_t cnt, loff_t *ppos)
117 char buf[64];
118 int len;
119 u8 *trace_type;
120 len = 0;
121 trace_type = (u8 *)filp->private_data;
122 if (*trace_type == fc_trc_flag->fnic_trace)
123 len = sprintf(buf, "%d\n", fnic_tracing_enabled);
124 else if (*trace_type == fc_trc_flag->fc_trace)
125 len = sprintf(buf, "%d\n", fnic_fc_tracing_enabled);
126 else if (*trace_type == fc_trc_flag->fc_clear)
127 len = sprintf(buf, "%d\n", fnic_fc_trace_cleared);
128 else
129 pr_err("fnic: Cannot read to any debugfs file\n");
131 return simple_read_from_buffer(ubuf, cnt, ppos, buf, len);
135 * fnic_trace_ctrl_write -
136 * Write to trace_enable, fc_trace_enable or
137 * fc_trace_clear debugfs file
138 * @filp: The file pointer to write from.
139 * @ubuf: The buffer to copy the data from.
140 * @cnt: The number of bytes to write.
141 * @ppos: The position in the file to start writing to.
143 * Description:
144 * This routine writes data from user buffer @ubuf to buffer @buf and
145 * sets fc_trace_enable ,tracing_enable or fnic_fc_trace_cleared
146 * value as per user input.
148 * Returns:
149 * This function returns the amount of data that was written.
151 static ssize_t fnic_trace_ctrl_write(struct file *filp,
152 const char __user *ubuf,
153 size_t cnt, loff_t *ppos)
155 char buf[64];
156 unsigned long val;
157 int ret;
158 u8 *trace_type;
159 trace_type = (u8 *)filp->private_data;
161 if (cnt >= sizeof(buf))
162 return -EINVAL;
164 if (copy_from_user(&buf, ubuf, cnt))
165 return -EFAULT;
167 buf[cnt] = 0;
169 ret = kstrtoul(buf, 10, &val);
170 if (ret < 0)
171 return ret;
173 if (*trace_type == fc_trc_flag->fnic_trace)
174 fnic_tracing_enabled = val;
175 else if (*trace_type == fc_trc_flag->fc_trace)
176 fnic_fc_tracing_enabled = val;
177 else if (*trace_type == fc_trc_flag->fc_clear)
178 fnic_fc_trace_cleared = val;
179 else
180 pr_err("fnic: cannot write to any debugfs file\n");
182 (*ppos)++;
184 return cnt;
187 static const struct file_operations fnic_trace_ctrl_fops = {
188 .owner = THIS_MODULE,
189 .open = simple_open,
190 .read = fnic_trace_ctrl_read,
191 .write = fnic_trace_ctrl_write,
195 * fnic_trace_debugfs_open - Open the fnic trace log
196 * @inode: The inode pointer
197 * @file: The file pointer to attach the log output
199 * Description:
200 * This routine is the entry point for the debugfs open file operation.
201 * It allocates the necessary buffer for the log, fills the buffer from
202 * the in-memory log and then returns a pointer to that log in
203 * the private_data field in @file.
205 * Returns:
206 * This function returns zero if successful. On error it will return
207 * a negative error value.
209 static int fnic_trace_debugfs_open(struct inode *inode,
210 struct file *file)
212 fnic_dbgfs_t *fnic_dbg_prt;
213 u8 *rdata_ptr;
214 rdata_ptr = (u8 *)inode->i_private;
215 fnic_dbg_prt = kzalloc(sizeof(fnic_dbgfs_t), GFP_KERNEL);
216 if (!fnic_dbg_prt)
217 return -ENOMEM;
219 if (*rdata_ptr == fc_trc_flag->fnic_trace) {
220 fnic_dbg_prt->buffer = vmalloc(array3_size(3, trace_max_pages,
221 PAGE_SIZE));
222 if (!fnic_dbg_prt->buffer) {
223 kfree(fnic_dbg_prt);
224 return -ENOMEM;
226 memset((void *)fnic_dbg_prt->buffer, 0,
227 3 * (trace_max_pages * PAGE_SIZE));
228 fnic_dbg_prt->buffer_len = fnic_get_trace_data(fnic_dbg_prt);
229 } else {
230 fnic_dbg_prt->buffer =
231 vmalloc(array3_size(3, fnic_fc_trace_max_pages,
232 PAGE_SIZE));
233 if (!fnic_dbg_prt->buffer) {
234 kfree(fnic_dbg_prt);
235 return -ENOMEM;
237 memset((void *)fnic_dbg_prt->buffer, 0,
238 3 * (fnic_fc_trace_max_pages * PAGE_SIZE));
239 fnic_dbg_prt->buffer_len =
240 fnic_fc_trace_get_data(fnic_dbg_prt, *rdata_ptr);
242 file->private_data = fnic_dbg_prt;
244 return 0;
248 * fnic_trace_debugfs_lseek - Seek through a debugfs file
249 * @file: The file pointer to seek through.
250 * @offset: The offset to seek to or the amount to seek by.
251 * @howto: Indicates how to seek.
253 * Description:
254 * This routine is the entry point for the debugfs lseek file operation.
255 * The @howto parameter indicates whether @offset is the offset to directly
256 * seek to, or if it is a value to seek forward or reverse by. This function
257 * figures out what the new offset of the debugfs file will be and assigns
258 * that value to the f_pos field of @file.
260 * Returns:
261 * This function returns the new offset if successful and returns a negative
262 * error if unable to process the seek.
264 static loff_t fnic_trace_debugfs_lseek(struct file *file,
265 loff_t offset,
266 int howto)
268 fnic_dbgfs_t *fnic_dbg_prt = file->private_data;
269 return fixed_size_llseek(file, offset, howto,
270 fnic_dbg_prt->buffer_len);
274 * fnic_trace_debugfs_read - Read a debugfs file
275 * @file: The file pointer to read from.
276 * @ubuf: The buffer to copy the data to.
277 * @nbytes: The number of bytes to read.
278 * @pos: The position in the file to start reading from.
280 * Description:
281 * This routine reads data from the buffer indicated in the private_data
282 * field of @file. It will start reading at @pos and copy up to @nbytes of
283 * data to @ubuf.
285 * Returns:
286 * This function returns the amount of data that was read (this could be
287 * less than @nbytes if the end of the file was reached).
289 static ssize_t fnic_trace_debugfs_read(struct file *file,
290 char __user *ubuf,
291 size_t nbytes,
292 loff_t *pos)
294 fnic_dbgfs_t *fnic_dbg_prt = file->private_data;
295 int rc = 0;
296 rc = simple_read_from_buffer(ubuf, nbytes, pos,
297 fnic_dbg_prt->buffer,
298 fnic_dbg_prt->buffer_len);
299 return rc;
303 * fnic_trace_debugfs_release - Release the buffer used to store
304 * debugfs file data
305 * @inode: The inode pointer
306 * @file: The file pointer that contains the buffer to release
308 * Description:
309 * This routine frees the buffer that was allocated when the debugfs
310 * file was opened.
312 * Returns:
313 * This function returns zero.
315 static int fnic_trace_debugfs_release(struct inode *inode,
316 struct file *file)
318 fnic_dbgfs_t *fnic_dbg_prt = file->private_data;
320 vfree(fnic_dbg_prt->buffer);
321 kfree(fnic_dbg_prt);
322 return 0;
325 static const struct file_operations fnic_trace_debugfs_fops = {
326 .owner = THIS_MODULE,
327 .open = fnic_trace_debugfs_open,
328 .llseek = fnic_trace_debugfs_lseek,
329 .read = fnic_trace_debugfs_read,
330 .release = fnic_trace_debugfs_release,
334 * fnic_trace_debugfs_init - Initialize debugfs for fnic trace logging
336 * Description:
337 * When Debugfs is configured this routine sets up the fnic debugfs
338 * file system. If not already created, this routine will create the
339 * create file trace to log fnic trace buffer output into debugfs and
340 * it will also create file trace_enable to control enable/disable of
341 * trace logging into trace buffer.
343 void fnic_trace_debugfs_init(void)
345 fnic_trace_enable = debugfs_create_file("tracing_enable",
346 S_IFREG|S_IRUGO|S_IWUSR,
347 fnic_trace_debugfs_root,
348 &(fc_trc_flag->fnic_trace),
349 &fnic_trace_ctrl_fops);
351 fnic_trace_debugfs_file = debugfs_create_file("trace",
352 S_IFREG|S_IRUGO|S_IWUSR,
353 fnic_trace_debugfs_root,
354 &(fc_trc_flag->fnic_trace),
355 &fnic_trace_debugfs_fops);
359 * fnic_trace_debugfs_terminate - Tear down debugfs infrastructure
361 * Description:
362 * When Debugfs is configured this routine removes debugfs file system
363 * elements that are specific to fnic trace logging.
365 void fnic_trace_debugfs_terminate(void)
367 debugfs_remove(fnic_trace_debugfs_file);
368 fnic_trace_debugfs_file = NULL;
370 debugfs_remove(fnic_trace_enable);
371 fnic_trace_enable = NULL;
375 * fnic_fc_trace_debugfs_init -
376 * Initialize debugfs for fnic control frame trace logging
378 * Description:
379 * When Debugfs is configured this routine sets up the fnic_fc debugfs
380 * file system. If not already created, this routine will create the
381 * create file trace to log fnic fc trace buffer output into debugfs and
382 * it will also create file fc_trace_enable to control enable/disable of
383 * trace logging into trace buffer.
386 void fnic_fc_trace_debugfs_init(void)
388 fnic_fc_trace_enable = debugfs_create_file("fc_trace_enable",
389 S_IFREG|S_IRUGO|S_IWUSR,
390 fnic_trace_debugfs_root,
391 &(fc_trc_flag->fc_trace),
392 &fnic_trace_ctrl_fops);
394 fnic_fc_trace_clear = debugfs_create_file("fc_trace_clear",
395 S_IFREG|S_IRUGO|S_IWUSR,
396 fnic_trace_debugfs_root,
397 &(fc_trc_flag->fc_clear),
398 &fnic_trace_ctrl_fops);
400 fnic_fc_rdata_trace_debugfs_file =
401 debugfs_create_file("fc_trace_rdata",
402 S_IFREG|S_IRUGO|S_IWUSR,
403 fnic_trace_debugfs_root,
404 &(fc_trc_flag->fc_normal_file),
405 &fnic_trace_debugfs_fops);
407 fnic_fc_trace_debugfs_file =
408 debugfs_create_file("fc_trace",
409 S_IFREG|S_IRUGO|S_IWUSR,
410 fnic_trace_debugfs_root,
411 &(fc_trc_flag->fc_row_file),
412 &fnic_trace_debugfs_fops);
416 * fnic_fc_trace_debugfs_terminate - Tear down debugfs infrastructure
418 * Description:
419 * When Debugfs is configured this routine removes debugfs file system
420 * elements that are specific to fnic_fc trace logging.
423 void fnic_fc_trace_debugfs_terminate(void)
425 debugfs_remove(fnic_fc_trace_debugfs_file);
426 fnic_fc_trace_debugfs_file = NULL;
428 debugfs_remove(fnic_fc_rdata_trace_debugfs_file);
429 fnic_fc_rdata_trace_debugfs_file = NULL;
431 debugfs_remove(fnic_fc_trace_enable);
432 fnic_fc_trace_enable = NULL;
434 debugfs_remove(fnic_fc_trace_clear);
435 fnic_fc_trace_clear = NULL;
439 * fnic_reset_stats_open - Open the reset_stats file
440 * @inode: The inode pointer.
441 * @file: The file pointer to attach the stats reset flag.
443 * Description:
444 * This routine opens a debugsfs file reset_stats and stores i_private data
445 * to debug structure to retrieve later for while performing other
446 * file oprations.
448 * Returns:
449 * This function returns zero if successful.
451 static int fnic_reset_stats_open(struct inode *inode, struct file *file)
453 struct stats_debug_info *debug;
455 debug = kzalloc(sizeof(struct stats_debug_info), GFP_KERNEL);
456 if (!debug)
457 return -ENOMEM;
459 debug->i_private = inode->i_private;
461 file->private_data = debug;
463 return 0;
467 * fnic_reset_stats_read - Read a reset_stats debugfs file
468 * @filp: The file pointer to read from.
469 * @ubuf: The buffer to copy the data to.
470 * @cnt: The number of bytes to read.
471 * @ppos: The position in the file to start reading from.
473 * Description:
474 * This routine reads value of variable reset_stats
475 * and stores into local @buf. It will start reading file at @ppos and
476 * copy up to @cnt of data to @ubuf from @buf.
478 * Returns:
479 * This function returns the amount of data that was read.
481 static ssize_t fnic_reset_stats_read(struct file *file,
482 char __user *ubuf,
483 size_t cnt, loff_t *ppos)
485 struct stats_debug_info *debug = file->private_data;
486 struct fnic *fnic = (struct fnic *)debug->i_private;
487 char buf[64];
488 int len;
490 len = sprintf(buf, "%u\n", fnic->reset_stats);
492 return simple_read_from_buffer(ubuf, cnt, ppos, buf, len);
496 * fnic_reset_stats_write - Write to reset_stats debugfs file
497 * @filp: The file pointer to write from.
498 * @ubuf: The buffer to copy the data from.
499 * @cnt: The number of bytes to write.
500 * @ppos: The position in the file to start writing to.
502 * Description:
503 * This routine writes data from user buffer @ubuf to buffer @buf and
504 * resets cumulative stats of fnic.
506 * Returns:
507 * This function returns the amount of data that was written.
509 static ssize_t fnic_reset_stats_write(struct file *file,
510 const char __user *ubuf,
511 size_t cnt, loff_t *ppos)
513 struct stats_debug_info *debug = file->private_data;
514 struct fnic *fnic = (struct fnic *)debug->i_private;
515 struct fnic_stats *stats = &fnic->fnic_stats;
516 u64 *io_stats_p = (u64 *)&stats->io_stats;
517 u64 *fw_stats_p = (u64 *)&stats->fw_stats;
518 char buf[64];
519 unsigned long val;
520 int ret;
522 if (cnt >= sizeof(buf))
523 return -EINVAL;
525 if (copy_from_user(&buf, ubuf, cnt))
526 return -EFAULT;
528 buf[cnt] = 0;
530 ret = kstrtoul(buf, 10, &val);
531 if (ret < 0)
532 return ret;
534 fnic->reset_stats = val;
536 if (fnic->reset_stats) {
537 /* Skip variable is used to avoid descrepancies to Num IOs
538 * and IO Completions stats. Skip incrementing No IO Compls
539 * for pending active IOs after reset stats
541 atomic64_set(&fnic->io_cmpl_skip,
542 atomic64_read(&stats->io_stats.active_ios));
543 memset(&stats->abts_stats, 0, sizeof(struct abort_stats));
544 memset(&stats->term_stats, 0,
545 sizeof(struct terminate_stats));
546 memset(&stats->reset_stats, 0, sizeof(struct reset_stats));
547 memset(&stats->misc_stats, 0, sizeof(struct misc_stats));
548 memset(&stats->vlan_stats, 0, sizeof(struct vlan_stats));
549 memset(io_stats_p+1, 0,
550 sizeof(struct io_path_stats) - sizeof(u64));
551 memset(fw_stats_p+1, 0,
552 sizeof(struct fw_stats) - sizeof(u64));
553 ktime_get_real_ts64(&stats->stats_timestamps.last_reset_time);
556 (*ppos)++;
557 return cnt;
561 * fnic_reset_stats_release - Release the buffer used to store
562 * debugfs file data
563 * @inode: The inode pointer
564 * @file: The file pointer that contains the buffer to release
566 * Description:
567 * This routine frees the buffer that was allocated when the debugfs
568 * file was opened.
570 * Returns:
571 * This function returns zero.
573 static int fnic_reset_stats_release(struct inode *inode,
574 struct file *file)
576 struct stats_debug_info *debug = file->private_data;
577 kfree(debug);
578 return 0;
582 * fnic_stats_debugfs_open - Open the stats file for specific host
583 * and get fnic stats.
584 * @inode: The inode pointer.
585 * @file: The file pointer to attach the specific host statistics.
587 * Description:
588 * This routine opens a debugsfs file stats of specific host and print
589 * fnic stats.
591 * Returns:
592 * This function returns zero if successful.
594 static int fnic_stats_debugfs_open(struct inode *inode,
595 struct file *file)
597 struct fnic *fnic = inode->i_private;
598 struct fnic_stats *fnic_stats = &fnic->fnic_stats;
599 struct stats_debug_info *debug;
600 int buf_size = 2 * PAGE_SIZE;
602 debug = kzalloc(sizeof(struct stats_debug_info), GFP_KERNEL);
603 if (!debug)
604 return -ENOMEM;
606 debug->debug_buffer = vmalloc(buf_size);
607 if (!debug->debug_buffer) {
608 kfree(debug);
609 return -ENOMEM;
612 debug->buf_size = buf_size;
613 memset((void *)debug->debug_buffer, 0, buf_size);
614 debug->buffer_len = fnic_get_stats_data(debug, fnic_stats);
616 file->private_data = debug;
618 return 0;
622 * fnic_stats_debugfs_read - Read a debugfs file
623 * @file: The file pointer to read from.
624 * @ubuf: The buffer to copy the data to.
625 * @nbytes: The number of bytes to read.
626 * @pos: The position in the file to start reading from.
628 * Description:
629 * This routine reads data from the buffer indicated in the private_data
630 * field of @file. It will start reading at @pos and copy up to @nbytes of
631 * data to @ubuf.
633 * Returns:
634 * This function returns the amount of data that was read (this could be
635 * less than @nbytes if the end of the file was reached).
637 static ssize_t fnic_stats_debugfs_read(struct file *file,
638 char __user *ubuf,
639 size_t nbytes,
640 loff_t *pos)
642 struct stats_debug_info *debug = file->private_data;
643 int rc = 0;
644 rc = simple_read_from_buffer(ubuf, nbytes, pos,
645 debug->debug_buffer,
646 debug->buffer_len);
647 return rc;
651 * fnic_stats_stats_release - Release the buffer used to store
652 * debugfs file data
653 * @inode: The inode pointer
654 * @file: The file pointer that contains the buffer to release
656 * Description:
657 * This routine frees the buffer that was allocated when the debugfs
658 * file was opened.
660 * Returns:
661 * This function returns zero.
663 static int fnic_stats_debugfs_release(struct inode *inode,
664 struct file *file)
666 struct stats_debug_info *debug = file->private_data;
667 vfree(debug->debug_buffer);
668 kfree(debug);
669 return 0;
672 static const struct file_operations fnic_stats_debugfs_fops = {
673 .owner = THIS_MODULE,
674 .open = fnic_stats_debugfs_open,
675 .read = fnic_stats_debugfs_read,
676 .release = fnic_stats_debugfs_release,
679 static const struct file_operations fnic_reset_debugfs_fops = {
680 .owner = THIS_MODULE,
681 .open = fnic_reset_stats_open,
682 .read = fnic_reset_stats_read,
683 .write = fnic_reset_stats_write,
684 .release = fnic_reset_stats_release,
688 * fnic_stats_init - Initialize stats struct and create stats file per fnic
690 * Description:
691 * When Debugfs is configured this routine sets up the stats file per fnic
692 * It will create file stats and reset_stats under statistics/host# directory
693 * to log per fnic stats.
695 void fnic_stats_debugfs_init(struct fnic *fnic)
697 char name[16];
699 snprintf(name, sizeof(name), "host%d", fnic->lport->host->host_no);
701 fnic->fnic_stats_debugfs_host = debugfs_create_dir(name,
702 fnic_stats_debugfs_root);
704 fnic->fnic_stats_debugfs_file = debugfs_create_file("stats",
705 S_IFREG|S_IRUGO|S_IWUSR,
706 fnic->fnic_stats_debugfs_host,
707 fnic,
708 &fnic_stats_debugfs_fops);
710 fnic->fnic_reset_debugfs_file = debugfs_create_file("reset_stats",
711 S_IFREG|S_IRUGO|S_IWUSR,
712 fnic->fnic_stats_debugfs_host,
713 fnic,
714 &fnic_reset_debugfs_fops);
718 * fnic_stats_debugfs_remove - Tear down debugfs infrastructure of stats
720 * Description:
721 * When Debugfs is configured this routine removes debugfs file system
722 * elements that are specific to fnic stats.
724 void fnic_stats_debugfs_remove(struct fnic *fnic)
726 if (!fnic)
727 return;
729 debugfs_remove(fnic->fnic_stats_debugfs_file);
730 fnic->fnic_stats_debugfs_file = NULL;
732 debugfs_remove(fnic->fnic_reset_debugfs_file);
733 fnic->fnic_reset_debugfs_file = NULL;
735 debugfs_remove(fnic->fnic_stats_debugfs_host);
736 fnic->fnic_stats_debugfs_host = NULL;