blob: 9872943f2a524d8f7751014b51c6fa7f35acd913 [file] [log] [blame]
Radhakrishna Jiguru1c9b2252013-08-27 23:57:48 +05301/*
2 **************************************************************************
Manish Verma51973ce2020-01-20 23:13:37 +05303 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
Radhakrishna Jiguru1c9b2252013-08-27 23:57:48 +05304 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all copies.
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 **************************************************************************
15 */
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053016
Yu Huang8c107082017-07-24 14:58:26 -070017#include "nss_core.h"
Wayne Tanb45933c2020-01-06 17:19:25 -080018#include "nss_strings.h"
Thomas Wuc3e382c2014-10-29 15:35:13 -070019
20/*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070021 * Maximum banner length:
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053022 */
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070023#define NSS_STATS_BANNER_MAX_LENGTH 80
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053024
25/*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070026 * Maximum number of digits a stats value can have:
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053027 */
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070028#define NSS_STATS_DIGITS_MAX 16
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053029
30/*
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -070031 * Spaces to print core details inside banner
32 */
33#define NSS_STATS_BANNER_SPACES 12
34
35/*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070036 * Max characters for a node name.
Abhishek Rastogi38cffff2013-06-02 11:25:47 +053037 */
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070038#define NSS_STATS_NODE_NAME_MAX 24
39
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -070040int nonzero_stats_print = 0;
41
42/*
43 * nss_stats_spacing()
44 * Framework to maintain consistent spacing between stats value and stats type.
45 */
46static size_t nss_stats_spacing(uint64_t stats_val, char *lbuf, size_t size_wr, size_t size_al)
47{
48 int i;
49 int digit_counter = (stats_val == 0 ? 1 : 0);
50 while (stats_val != 0) {
51 /*
52 * TODO: need to check for (nss_ptr_t)
53 */
54 stats_val = (nss_ptr_t)stats_val / 10;
55 digit_counter++;
56 }
57
58 for (i = 0; i < NSS_STATS_DIGITS_MAX - digit_counter; i++) {
59 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " ");
60 }
61
62 return size_wr;
63}
64
65/*
66 * nss_stats_nonzero_handler()
67 * Handler to take nonzero stats print configuration.
68 */
69static int nss_stats_nonzero_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
70{
71 int ret;
72 ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
73 return ret;
74}
75
76static struct ctl_table nss_stats_table[] = {
77 {
78 .procname = "non_zero_stats",
79 .data = &nonzero_stats_print,
80 .maxlen = sizeof(int),
81 .mode = 0644,
82 .proc_handler = &nss_stats_nonzero_handler,
83 },
84 { }
85};
86
87static struct ctl_table nss_stats_dir[] = {
88 {
89 .procname = "stats",
90 .mode = 0555,
91 .child = nss_stats_table,
92 },
93 { }
94};
95
96static struct ctl_table nss_stats_root_dir[] = {
97 {
98 .procname = "nss",
99 .mode = 0555,
100 .child = nss_stats_dir,
101 },
102 { }
103};
104
105static struct ctl_table nss_stats_root[] = {
106 {
107 .procname = "dev",
108 .mode = 0555,
109 .child = nss_stats_root_dir,
110 },
111 { }
112};
113static struct ctl_table_header *nss_stats_header;
114
115/*
116 * nss_stats_register_sysctl()
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700117 * Register a sysctl table for stats.
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700118 */
119void nss_stats_register_sysctl(void)
120{
121 /*
122 * Register sysctl table.
123 */
124 nss_stats_header = register_sysctl_table(nss_stats_root);
125}
126
127/*
128 * nss_stats_open()
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700129 * Opens stats file.
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700130 */
131int nss_stats_open(struct inode *inode, struct file *filp)
132{
133 struct nss_stats_data *data = NULL;
134
135 data = kzalloc(sizeof(struct nss_stats_data), GFP_KERNEL);
136 if (!data) {
137 return -ENOMEM;
138 }
139
140 memset(data, 0, sizeof (struct nss_stats_data));
141 data->if_num = NSS_DYNAMIC_IF_START;
142 data->index = 0;
143 data->edma_id = (nss_ptr_t)inode->i_private;
144 data->nss_ctx = (struct nss_ctx_instance *)(inode->i_private);
145 filp->private_data = data;
146
147 return 0;
148}
149
150/*
151 * nss_stats_release()
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700152 * Releases stats file.
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700153 */
154int nss_stats_release(struct inode *inode, struct file *filp)
155{
156 struct nss_stats_data *data = filp->private_data;
157
158 if (data) {
159 kfree(data);
160 }
161
162 return 0;
163}
164
165/*
166 * nss_stats_clean()
167 * Cleanup NSS statistics files.
168 */
169void nss_stats_clean(void)
170{
171 /*
172 * Remove debugfs tree
173 */
174 if (likely(nss_top_main.top_dentry != NULL)) {
175 debugfs_remove_recursive(nss_top_main.top_dentry);
176 nss_top_main.top_dentry = NULL;
177 }
178}
179
180/*
Manish Verma51973ce2020-01-20 23:13:37 +0530181 * nss_stats_reset_common_stats()
182 * Reset common node statistics.
183 */
184void nss_stats_reset_common_stats(uint32_t if_num)
185{
186 if (unlikely(if_num >= NSS_MAX_NET_INTERFACES)) {
187 return;
188 }
189
190 spin_lock_bh(&nss_top_main.stats_lock);
191 memset(nss_top_main.stats_node[if_num], 0, NSS_STATS_NODE_MAX * sizeof(uint64_t));
192 spin_unlock_bh(&nss_top_main.stats_lock);
193}
194
195/*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700196 * nss_stats_fill_common_stats()
197 * Fill common node statistics.
198 */
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700199size_t nss_stats_fill_common_stats(uint32_t if_num, int instance, char *lbuf, size_t size_wr, size_t size_al, char *node)
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700200{
201 uint64_t stats_val[NSS_STATS_NODE_MAX];
202 int i;
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700203 size_t orig_size_wr = size_wr;
204
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700205 spin_lock_bh(&nss_top_main.stats_lock);
206 for (i = 0; i < NSS_STATS_NODE_MAX; i++) {
207 stats_val[i] = nss_top_main.stats_node[if_num][i];
208 }
209
210 spin_unlock_bh(&nss_top_main.stats_lock);
Wayne Tanb45933c2020-01-06 17:19:25 -0800211 size_wr += nss_stats_print(node, NULL, instance, nss_strings_stats_node, stats_val, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al);
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700212 return size_wr - orig_size_wr;
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700213}
214
215/*
216 * nss_stats_banner()
217 * Printing banner for node.
218 */
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700219size_t nss_stats_banner(char *lbuf, size_t size_wr, size_t size_al, char *node, int core)
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700220{
221 uint16_t banner_char_length, i;
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700222 size_t orig_size_wr = size_wr;
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700223 char node_upr[NSS_STATS_NODE_NAME_MAX + 1];
224
225 if (strlen(node) > NSS_STATS_NODE_NAME_MAX) {
226 nss_warning("Node name %s larger than %d characters\n", node, NSS_STATS_NODE_NAME_MAX);
227 return 0;
228 }
229
230 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
231 for (i = 0; i < NSS_STATS_BANNER_MAX_LENGTH ; i++) {
232 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "_");
233 }
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700234 if (core > NSS_STATS_SINGLE_CORE) {
235 banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + NSS_STATS_BANNER_SPACES)) / 2);
236 } else {
237 banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + 2)) / 2);
238 }
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700239
240 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n");
241 for (i = 0; i < banner_char_length; i++) {
242 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "<");
243 }
244
245 strlcpy(node_upr, node, NSS_STATS_NODE_NAME_MAX);
246 for (i = 0; node_upr[i] != '\0' && i < NSS_STATS_NODE_NAME_MAX; i++) {
247 node_upr[i] = toupper(node_upr[i]);
248 }
249
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700250 /*
251 * TODO: Enhance so that both core0 and core1 print the same way for a
252 * node that has presence in both cores. i.e. Core0 should have [CORE 0]
253 * and not just Core1.
254 */
255 if (core > 1) {
256 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s [CORE %d] ", node_upr, core);
257 } else {
258 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s ", node_upr);
259 }
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700260 for (i = 0; i < banner_char_length; i++) {
261 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, ">");
262 }
263
264 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
265 for (i = 0; i < NSS_STATS_BANNER_MAX_LENGTH; i++) {
266 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "_");
267 }
268
269 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n");
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700270 return size_wr - orig_size_wr;
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700271}
272
273/*
274 * nss_stats_print()
275 * Helper API to print stats.
276 */
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700277size_t nss_stats_print(char *node, char *stat_details, int instance, struct nss_stats_info *stats_info,
278 uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al)
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700279{
280 uint16_t i, j;
281 uint16_t maxlen = 0;
282 char stats_string[NSS_STATS_MAX_STR_LENGTH];
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700283 size_t orig_size_wr = size_wr;
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700284 char node_lwr[NSS_STATS_NODE_NAME_MAX + 1];
285
286 if (strlen(node) > NSS_STATS_NODE_NAME_MAX) {
287 nss_warning("Node name %s (%u chars) is longer than max chars of %d\n",
288 node, (uint32_t)strlen(node), NSS_STATS_NODE_NAME_MAX);
289 return 0;
290 }
291
292 /*
293 * Calculating the maximum of the array for indentation purposes.
294 */
295 for (i = 0; i < max; i++){
296 if (strlen(stats_info[i].stats_name) > maxlen) {
297 maxlen = strlen(stats_info[i].stats_name);
298 }
299 }
300
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700301 if (stat_details != NULL) {
302 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n#%s\n\n", stat_details);
303 }
304
305 for (i = 0; i < max; i++){
306 if (nonzero_stats_print == 1 && stats_val[i] == 0) {
307 continue;
308 }
309
310 strlcpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
311
312 /*
313 * Converting uppercase to lower case.
314 */
315 for (j = 0; stats_string[j] != '\0' && j < NSS_STATS_MAX_STR_LENGTH; j++) {
316 stats_string[j] = tolower(stats_string[j]);
317 }
318
319 strlcpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX);
320 for (j = 0; node_lwr[j] != '\0' && j < NSS_STATS_NODE_NAME_MAX; j++) {
321 node_lwr[j] = tolower(node_lwr[j]);
322 }
323
324 /*
325 * Space before %s is needed to avoid printing stat name from start of the line.
326 */
327 if (instance < 0) {
328 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\t%s_%s", node_lwr, stats_string);
329 } else {
330 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\t%s[%d]_%s", node_lwr, instance, stats_string);
331 }
332
333 for (j = 0; j < (1 + maxlen - strlen(stats_string)); j++){
334 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " ");
335 }
336
337 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "= %llu", stats_val[i]);
338 size_wr = nss_stats_spacing(stats_val[i], lbuf, size_wr, size_al);
339
340 /*
341 * Switch case will take care of the indentation and spacing details.
342 */
343 switch (stats_info[i].stats_type) {
344 case NSS_STATS_TYPE_COMMON:
345 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "common\n");
346 break;
347
348 case NSS_STATS_TYPE_SPECIAL:
349 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "special\n");
350 break;
351
352 case NSS_STATS_TYPE_DROP:
353 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "drop\n");
354 break;
355
356 case NSS_STATS_TYPE_ERROR:
357 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "error\n");
358 break;
359
360 case NSS_STATS_TYPE_EXCEPTION:
361 size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "exception\n");
362 break;
363
364 default:
365 nss_warning("unknown statistics type");
366 break;
367 }
368 }
369
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700370 return size_wr - orig_size_wr;
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700371}
372
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530373/*
Yu Huang8c107082017-07-24 14:58:26 -0700374 * nss_stats_create_dentry()
375 * Create statistics debug entry for subsystem.
Murat Sezgin99dab642014-08-28 14:40:34 -0700376 */
Yu Huang8c107082017-07-24 14:58:26 -0700377void nss_stats_create_dentry(char *name, const struct file_operations *ops)
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530378{
Yu Huang8c107082017-07-24 14:58:26 -0700379 if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
Cemil Coskun26be6162019-06-28 15:44:48 -0700380 nss_warning("Failed to create debug entry for subsystem %s\n", name);
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530381 }
Yu Huang8c107082017-07-24 14:58:26 -0700382}
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530383
Yu Huang8c107082017-07-24 14:58:26 -0700384/*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700385 * TODO: Move the rest of the code to (nss_wt_stats.c, nss_gmac_stats.c, nss_drv_stats.c) accordingly.
Yu Huang8c107082017-07-24 14:58:26 -0700386 */
Saurabh Misra09dddeb2014-09-30 16:38:07 -0700387
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530388/*
389 * drv_stats_ops
390 */
Wayne Tanb45933c2020-01-06 17:19:25 -0800391NSS_STATS_DECLARE_FILE_OPERATIONS(drv);
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530392
393/*
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530394 * gmac_stats_ops
395 */
Wayne Tanb45933c2020-01-06 17:19:25 -0800396NSS_STATS_DECLARE_FILE_OPERATIONS(gmac);
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530397
398/*
Jackson Bockusc2a4e682017-06-23 11:59:29 -0700399 * wt_stats_ops
400 */
Wayne Tanb45933c2020-01-06 17:19:25 -0800401NSS_STATS_DECLARE_FILE_OPERATIONS(wt);
Yu Huang8c107082017-07-24 14:58:26 -0700402
403/*
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530404 * nss_stats_init()
Sakthi Vignesh Radhakrishnan1ceafde2019-08-23 13:05:00 -0700405 * Enable NSS statistics.
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530406 */
407void nss_stats_init(void)
408{
Jackson Bockusc2a4e682017-06-23 11:59:29 -0700409 struct dentry *core_dentry = NULL;
410 struct dentry *wt_dentry = NULL;
Shashank Balashankar512cb602016-08-01 17:57:42 -0700411 char file_name[10];
Yu Huang8c107082017-07-24 14:58:26 -0700412 int i;
Shashank Balashankar512cb602016-08-01 17:57:42 -0700413
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530414 /*
415 * NSS driver entry
416 */
417 nss_top_main.top_dentry = debugfs_create_dir("qca-nss-drv", NULL);
418 if (unlikely(nss_top_main.top_dentry == NULL)) {
419 nss_warning("Failed to create qca-nss-drv directory in debugfs");
420
421 /*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700422 * Non availability of debugfs directory is not a catastrophy.
423 * We can still go ahead with other initialization.
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530424 */
425 return;
426 }
427
428 nss_top_main.stats_dentry = debugfs_create_dir("stats", nss_top_main.top_dentry);
Abhishek Rastogi80f4eb12013-09-24 14:31:21 +0530429 if (unlikely(nss_top_main.stats_dentry == NULL)) {
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530430 nss_warning("Failed to create qca-nss-drv directory in debugfs");
431
432 /*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700433 * Non availability of debugfs directory is not a catastrophy.
434 * We can still go ahead with rest of initialization.
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530435 */
436 return;
437 }
438
439 /*
Sakthi Vignesh Radhakrishnan150c5592019-07-02 10:17:44 -0700440 * Create files to obtain statistics.
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530441 */
442
443 /*
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530444 * drv_stats
445 */
Yu Huang8c107082017-07-24 14:58:26 -0700446 nss_stats_create_dentry("drv", &nss_drv_stats_ops);
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530447
448 /*
449 * gmac_stats
450 */
Yu Huang8c107082017-07-24 14:58:26 -0700451 nss_stats_create_dentry("gmac", &nss_gmac_stats_ops);
Aniruddha Paul1b170c22017-05-29 12:30:39 +0530452
Jackson Bockusc2a4e682017-06-23 11:59:29 -0700453 /*
454 * Per-project stats
455 */
456 nss_top_main.project_dentry = debugfs_create_dir("project",
457 nss_top_main.stats_dentry);
458 if (unlikely(nss_top_main.project_dentry == NULL)) {
459 nss_warning("Failed to create qca-nss-drv/stats/project directory in debugfs");
460 return;
461 }
462
Suman Ghosh9f7b3702018-09-21 19:51:40 +0530463 for (i = 0; i < nss_top_main.num_nss; ++i) {
Jackson Bockusc2a4e682017-06-23 11:59:29 -0700464 memset(file_name, 0, sizeof(file_name));
465 scnprintf(file_name, sizeof(file_name), "core%d", i);
466 core_dentry = debugfs_create_dir(file_name,
467 nss_top_main.project_dentry);
468 if (unlikely(core_dentry == NULL)) {
469 nss_warning("Failed to create qca-nss-drv/stats/project/core%d directory in debugfs", i);
470 return;
471 }
472
473 wt_dentry = debugfs_create_file("worker_threads",
474 0400,
475 core_dentry,
476 &(nss_top_main.nss[i]),
Yu Huang8c107082017-07-24 14:58:26 -0700477 &nss_wt_stats_ops);
Jackson Bockusc2a4e682017-06-23 11:59:29 -0700478 if (unlikely(wt_dentry == NULL)) {
479 nss_warning("Failed to create qca-nss-drv/stats/project/core%d/worker_threads file in debugfs", i);
480 return;
481 }
482 }
483
Saurabh Misra96998db2014-07-10 12:15:48 -0700484 nss_log_init();
Abhishek Rastogi38cffff2013-06-02 11:25:47 +0530485}