From c746083504becd552538a6315cccf7d689d77b09 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sat, 5 Oct 2024 00:08:10 -0400 Subject: [PATCH 1/2] nss-ecm: Disable rx-gro-list by default New option added to ecm config: `disable_gro_list` This config option defaults to '1' (AKA disable rx-gro-list) `rx-gro-list` is enabled by default in mainline OpenWrt, however it is very bug prone, and causes various issues related to UDP traffic (i.e DHCP, WireGuard, DNS, etc.) This option is not explicitly required. If a user sets this to '0', a warning will be shown in the logs everytime ECM is started. Signed-off-by: Sean Khan --- qca-nss-ecm/Makefile | 2 +- qca-nss-ecm/files/disable_offloads.sh | 20 +++++++++++++++----- qca-nss-ecm/files/qca-nss-ecm.uci | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/qca-nss-ecm/Makefile b/qca-nss-ecm/Makefile index 7922232..44b23c7 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:=1 +PKG_RELEASE:=2 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 648d2ed..d16f01f 100644 --- a/qca-nss-ecm/files/disable_offloads.sh +++ b/qca-nss-ecm/files/disable_offloads.sh @@ -100,16 +100,17 @@ disable_offloads() { fi } -disable_gro() { - local interface="$1" +disable_feature() { + local feature="$1" + local interface="$2" local cmd # Construct ethtool command line - cmd="-K $interface gro off" + cmd="-K $interface $feature off" # Try to disable flow control ethtool $cmd 1> /dev/null 2> /dev/null - log $? "Generic Receive Offload" "$interface" + log $? "Disabling feature: $feature" "($interface)" } disable_flow_control() { @@ -180,6 +181,7 @@ disable_offload() { config_get_bool disable_flow_control general disable_flow_control 0 config_get_bool disable_interrupt_moderation general disable_interrupt_moderation 0 config_get_bool disable_gro general disable_gro 0 + config_get_bool disable_gro_list general disable_gro_list 1 [ -z $1 ] && interface=$(echo /sys/class/net/*) || interface=$* @@ -192,7 +194,15 @@ disable_offload() { fi if [ "$disable_gro" -eq 1 ]; then - disable_gro "$i" + disable_feature gro "$i" + fi + + if [ "$disable_gro_list" -eq 1 ]; then + disable_feature "rx-gro-list" "$i" + else + logger -p user.warn -s "[ethtool] Enabling rx-gro-list (GRO Fraglist) will break UDP related traffic. (e.g. DNS, DHCP)" + logger -p user.warn -s "[ethtool] Leave this feature enabled unless you know what you are doing." + logger -p user.warn -s "[ethtool] Run \`uci set ecm.general.disable_gro_list=1 && uci commit ecm && service qca-nss-ecm restart\`" fi if [ "$disable_offloads" -eq 1 ]; then diff --git a/qca-nss-ecm/files/qca-nss-ecm.uci b/qca-nss-ecm/files/qca-nss-ecm.uci index 21a1dcc..b8c2ab2 100644 --- a/qca-nss-ecm/files/qca-nss-ecm.uci +++ b/qca-nss-ecm/files/qca-nss-ecm.uci @@ -7,3 +7,4 @@ config ecm 'general' option disable_flow_control '0' option disable_interrupt_moderation '0' option disable_gro '0' + option disable_gro_list '1' From 7dd1aff6748bc9feadf08605ae0b0a33653be2c1 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sat, 5 Oct 2024 00:16:26 -0400 Subject: [PATCH 2/2] nss-drv: Display GRO Fraglist instead of GRO Replace showing `gro` (Generic Recieve Offload) with `rx-gro-list` (GRO Fraglist) as that is the more problematic feature known to cause issues. Signed-off-by: Sean Khan --- qca-nss-drv/Makefile | 2 +- qca-nss-drv/files/qca-nss-drv.diag | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qca-nss-drv/Makefile b/qca-nss-drv/Makefile index c94965b..0bbcd88 100644 --- a/qca-nss-drv/Makefile +++ b/qca-nss-drv/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-nss-drv -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git PKG_SOURCE_PROTO:=git diff --git a/qca-nss-drv/files/qca-nss-drv.diag b/qca-nss-drv/files/qca-nss-drv.diag index 22c3c10..1947693 100755 --- a/qca-nss-drv/files/qca-nss-drv.diag +++ b/qca-nss-drv/files/qca-nss-drv.diag @@ -73,14 +73,14 @@ echo -e "${bold}${red} IPQ DATE${reset}: ${green}${ipq_date}${reset}" echo -e "${bold}${red} NSS FW${reset}: ${cyan}${nss_version}${reset}" echo -e "${bold}${red} MAC80211${reset}: ${white}${mac80211_version}${reset}${reset}" echo -e "${bold}${red} ATH11K FW${reset}: ${cyan}${ath11k_fw}${reset}" -echo -ne "${bold}${red} GRO${reset}${white}: " +echo -ne "${bold}${red} GRO FRAG${reset}: ${white}" count=0 for i in wan br-lan /sys/class/net/br-lan/brif/*; do i=${i##*\/} ethtool -k ${i} | awk -v count=$count -v i=$i -v white=$white -v green=$green -v r=$reset ' - /generic-receive-offload/ { + /rx-gro-list/ { if(count>0) tab=" " if($2=="on") color=green printf "%s%-11s : %s%s%s\n",tab,i,color,$2,r