nss-ecm: cutdown on log spam

Don't log if interface feature is already disabled.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
Sean Khan 2025-03-02 03:47:25 -05:00
parent e4489bb269
commit 967fb02dfb
2 changed files with 12 additions and 6 deletions

View File

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

View File

@ -104,13 +104,19 @@ disable_feature() {
local feature="$1"
local interface="$2"
local cmd
local current_state
# Construct ethtool command line
cmd="-K $interface $feature off"
current_state=$(ethtool -k $interface 2>/dev/null | awk -v feature="^$feature:" '$0 ~ feature {print $2}')
# Only disable and log if the feature is currently enabled
if [ "$current_state" = "on" ]; then
# Construct ethtool command line
cmd="-K $interface $feature off"
# Try to disable flow control
ethtool $cmd 1> /dev/null 2> /dev/null
log $? "Disabling feature: $feature" "($interface)"
# Try to disable the feature
ethtool $cmd 1> /dev/null 2> /dev/null
log $? "Disabling feature: $feature" "($interface)"
fi
}
disable_flow_control() {