qca-nss-drv: Avoid recreating debugfs entry virt_if

Everytime a virtual interface is created/destroyed, nss driver
tries to create a debugfs entry, without checking if it exists.
Prevent creation if it already exists. This will also prevent the
annoying kernel warning.

'virt_if' in directory 'stats' already present!
This commit is contained in:
Qosmio 2024-02-11 16:39:28 -05:00
parent 1ce879e50f
commit 123f0c1272
2 changed files with 15 additions and 1 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-drv
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
PKG_SOURCE_PROTO:=git

View File

@ -0,0 +1,14 @@
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -380,8 +380,9 @@ size_t nss_stats_print(char *node, char
*/
void nss_stats_create_dentry(char *name, const struct file_operations *ops)
{
- if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
- nss_warning("Failed to create debug entry for subsystem %s\n", name);
+ if (!debugfs_lookup(name, nss_top_main.stats_dentry))
+ if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
+ nss_warning("Failed to create debug entry for subsystem %s\n", name);
}
}