From 967fb02dfbbd4952324b1682b4629523c04ab266 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sun, 2 Mar 2025 03:47:25 -0500 Subject: [PATCH] nss-ecm: cutdown on log spam Don't log if interface feature is already disabled. Signed-off-by: Sean Khan --- qca-nss-ecm/Makefile | 2 +- qca-nss-ecm/files/disable_offloads.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qca-nss-ecm/Makefile b/qca-nss-ecm/Makefile index 508bfd4..97cd45f 100644 --- a/qca-nss-ecm/Makefile +++ b/qca-nss-ecm/Makefile @@ -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 diff --git a/qca-nss-ecm/files/disable_offloads.sh b/qca-nss-ecm/files/disable_offloads.sh index da1803a..ecae95a 100644 --- a/qca-nss-ecm/files/disable_offloads.sh +++ b/qca-nss-ecm/files/disable_offloads.sh @@ -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() {