mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 08:12:53 +00:00
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:
parent
e4489bb269
commit
967fb02dfb
@ -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
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user