Ipq806x NSS build (Netgear R7800 / TP-Link C2600 / Linksys EA8500)

Master acwififdude's 15 commits + rickkdotnet's 13 commits https://github.com/rickkdotnet/openwrt
& sqm nss script (both 22.03 & master/K5.15) https://github.com/rickkdotnet/sqm-scripts-nss

wifi test: r22235+28-a03076cc39

Summary

This text will be hidden
copy the nss-rk.qos and nss-rk.qos.help files to /usr/lib/sqm

cd /usr/lib/sqm
wget https://raw.githubusercontent.com/rickkdotnet/sqm-scripts-nss/main/files/usr/lib/sqm/nss-rk.qos
wget https://raw.githubusercontent.com/rickkdotnet/sqm-scripts-nss/main/files/usr/lib/sqm/nss-rk.qos.help
openwrt 
chmod 755 openwrt
git clone -b master https://github.com/openwrt/openwrt.git
cd openwrt
git remote add oldrepo https://github.com/ACwifidude/openwrt.git
git remote update
git cherry-pick 7112c43ba1f3d3b0ca3565d8bb1a3c8347e51f93
git cherry-pick b2869d0916b57bc596dc29c528147e5b9adacf02
git cherry-pick b157d4431289b85e34922b7f75f3211d7c2e2a74
git cherry-pick a9791db9388001df349ea9085d723daa2859c85d
git cherry-pick 9533fa7ac478643aca3e2a01e100e93f6e9e899f
git cherry-pick e91ffd20b984c24da7492510c6b759d8ef282dac
git cherry-pick db33232a1b7ce49a150b71025ef4d95256c153f2
git cherry-pick fa260b66cce4bfac2bf0c8db19f40f59d420f75d
git cherry-pick 164c783163465899c1dfb2847927b7906dcda4bd
git cherry-pick 6c78302e8fb1f701290b6dc4d0c8ab80b51ad467
git cherry-pick ad59f0dc053420d992e22bd5d3ded6d7d6ee6b1c
git cherry-pick 6b8cd38f8f379455bcf5b7186b5d36bb8760e93f
git cherry-pick 814cfb9ea486d3217d254f728293e7762cdade53
git cherry-pick 4418ce4b781c1b7b1e5fde34bfb8c6ae72323221
git cherry-pick b55ebb2d88b47b705003b4325a43fe7df3b9200f
git remote remove oldrepo
git remote add oldrepo https://github.com/rickkdotnet/openwrt.git
git remote update
git cherry-pick 9fc456193c1adcb73e4621698f9bb0eb2e3ee49b
git cherry-pick c3fb7c0eec8793f1a397a0e728c9552b474ad92b
git cherry-pick 21504780ddf8c3e0fd6af5170aa19c6eee2645d4
git cherry-pick 42552a831a0e39a5f1d43474e726f508ed11d645
git cherry-pick 585fb076315e4e3b6895616305a35ec25909ad0e
git cherry-pick f8208cecaced63ce1ebba69bc25a7415faa5abbc
git cherry-pick 61c44df6072f2e19ce9adc37c23607c8e4837fd8
git cherry-pick abf3a76cbd3e48fd556fe5e7e5946ce6bc9c1879
git cherry-pick f406bf30b798291589cc95dad97d012fb2407d41
git cherry-pick 0ccf95a6e4024d6a2805f09b72b023920504ae15
git cherry-pick 68215f2bc78d837b878734ec07e574b184ea829d
git cherry-pick e3ce4dc95a5dcdef5049df5d9d44cad78703ce6c
git cherry-pick 853c4ceb4fdced21a24b600091be843092703722
git remote remove oldrepo
git checkout master
git remote add upstream https://git.openwrt.org/openwrt/openwrt.git
git fetch upstream && git rebase upstream/master
git status

./scripts/feeds update -a && ./scripts/feeds install -a && cp diffconfig .config && make defconfig && ./scripts/getver.sh

make dirclean && make download && make -j9 V=s

diffconfig

# Use "make defconfig" to expand this to a full .config
CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_ipq806x_generic=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_r7800=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_netgear_r7800="-kmod-ath10k-ct -ath10k-firmware-qca9984-ct kmod-ath10k ath10k-firmware-qca9984"
CONFIG_TARGET_PER_DEVICE_ROOTFS=y

# exfat is patented
CONFIG_BUILD_PATENTED=y

CONFIG_TARGET_ARCH_PACKAGES="arm_cortex-a15_neon-vfpv4"
CONFIG_CPU_TYPE="cortex-a15+neon-vfpv4"
CONFIG_LINUX_5_15=y
CONFIG_HAS_FPU=y
CONFIG_USES_DEVICETREE=y
CONFIG_USES_INITRAMFS=y
CONFIG_USES_SQUASHFS=y
CONFIG_NAND_SUPPORT=y
CONFIG_arm=y
CONFIG_arm_v7=y
CONFIG_ARCH="arm"
CONFIG_TARGET_ROOTFS_INITRAMFS=y
CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE=y
CONFIG_TARGET_ROOTFS_SQUASHFS=y
CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=512
CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP=y
CONFIG_TARGET_UBIFS_JOURNAL_SIZE=""

# Kernel
CONFIG_KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE=y

# NSS Drivers
CONFIG_PACKAGE_kmod-qca-nss-drv=y
CONFIG_PACKAGE_kmod-qca-nss-ecm-standard=y
CONFIG_PACKAGE_kmod-qca-nss-gmac=y
CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc=y
CONFIG_PACKAGE_kmod-nss-ifb=y
CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe=y
CONFIG_PACKAGE_kmod-qca-nss-drv-pptp=y
CONFIG_PACKAGE_kmod-qca-nss-crypto=y
CONFIG_PACKAGE_kmod-qca-nss-drv-igs=y
CONFIG_PACKAGE_kmod-qca-nss-drv-netlink=y
CONFIG_PACKAGE_MAC80211_NSS_SUPPORT=y
# CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2 is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6 is not set

# Longer waiting for failsafe button push
CONFIG_IMAGEOPT=y
CONFIG_PREINITOPT=y
CONFIG_TARGET_PREINIT_TIMEOUT=5

# Busybox tweaks
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_WINCH=y

# Add-on programs
CONFIG_DROPBEAR_ECC=y
CONFIG_PACKAGE_aria2=y
CONFIG_PACKAGE_dnsproxy=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_kmod-cryptodev=y
CONFIG_PACKAGE_libopenssl-devcrypto=y
CONFIG_PACKAGE_kmod-dnsresolver=y
CONFIG_PACKAGE_kmod-ramoops=y
CONFIG_PACKAGE_kmod-pstore=y
CONFIG_PACKAGE_kmod-reed-solomon=y
# CONFIG_PACKAGE_kmod-pppol2tp is not set
CONFIG_PACKAGE_ds-lite=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_wget-ssl=y
CONFIG_PACKAGE_kmod-usb-printer=y

# USB device mount & file systems support
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_cryptsetup=y
CONFIG_PACKAGE_e2fsprogs=y
CONFIG_PACKAGE_f2fs-tools=y
CONFIG_PACKAGE_kmod-crypto-ecb=y
CONFIG_PACKAGE_kmod-crypto-xts=y
CONFIG_PACKAGE_kmod-crypto-iv=y
CONFIG_PACKAGE_kmod-crypto-misc=y
CONFIG_PACKAGE_kmod-crypto-user=y
CONFIG_PACKAGE_kmod-fs-exfat=y
CONFIG_PACKAGE_kmod-fs-ext4=y
CONFIG_PACKAGE_kmod-fs-f2fs=y
CONFIG_PACKAGE_kmod-fs-hfs=y
CONFIG_PACKAGE_kmod-fs-hfsplus=y
CONFIG_PACKAGE_kmod-fs-msdos=y
CONFIG_PACKAGE_kmod-fs-nfs=y
CONFIG_PACKAGE_kmod-fs-nfs-common=y
CONFIG_PACKAGE_kmod-fs-nfs-v3=y
CONFIG_PACKAGE_kmod-fs-nfs-v4=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-nls-cp1250=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-cp850=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-iso8859-15=y
CONFIG_PACKAGE_kmod-nls-utf8=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-storage-uas=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_nfs-utils=y

# IPv6 support
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6to4=y
CONFIG_PACKAGE_6rd=y

# WLAN/WPS support
CONFIG_PACKAGE_hostapd-utils=y
CONFIG_WPA_MSG_MIN_PRIORITY=4
CONFIG_PACKAGE_wireless-regdb=y
CONFIG_PACKAGE_wpad-openssl=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
# CONFIG_PACKAGE_libustream-wolfssl is not set
# CONFIG_PACKAGE_libmbedtls is not set
# CONFIG_PACKAGE_libustream-mbedtls is not set
# CONFIG_PACKAGE_wpad-basic-mbedtls is not set

# SSL certificates
CONFIG_PACKAGE_ca-certificates=y

# Luci (SSL from OpenSSL)
CONFIG_LUA_ECO_DEFAULT_OPENSSL=y
CONFIG_LUA_ECO_OPENSSL=y
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-app-commands=y
CONFIG_PACKAGE_luci-app-adblock=y
CONFIG_PACKAGE_luci-app-https-dns-proxy=y
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
CONFIG_PACKAGE_luci-app-sqm=y
CONFIG_PACKAGE_luci-proto-wireguard=y
CONFIG_PACKAGE_kmod-wireguard=y
CONFIG_PACKAGE_wireguard-tools=y
CONFIG_PACKAGE_openssl-util=y
# CONFIG_LUCI_JSMIN is not set
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_OPTIMIZE_SPEED=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_NO_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y

# Luci statistics
CONFIG_PACKAGE_luci-app-statistics=y
CONFIG_PACKAGE_collectd-mod-conntrack=y
CONFIG_PACKAGE_collectd-mod-cpufreq=y
CONFIG_PACKAGE_collectd-mod-dhcpleases=y
CONFIG_PACKAGE_collectd-mod-entropy=y
CONFIG_PACKAGE_collectd-mod-exec=y
CONFIG_PACKAGE_collectd-mod-thermal=y
CONFIG_PACKAGE_collectd-mod-wireless=y

CONFIG_PACKAGE_kmod-ath10k-ct=m
CONFIG_PACKAGE_kmod-ath10k=m
CONFIG_PACKAGE_ath10k-firmware-qca988x-ct=m
CONFIG_PACKAGE_ath10k-firmware-qca99x0-ct=m
CONFIG_PACKAGE_ath10k-firmware-qca9984-ct=m
CONFIG_PACKAGE_ath10k-firmware-qca988x=m
CONFIG_PACKAGE_ath10k-firmware-qca99x0=m
CONFIG_PACKAGE_ath10k-firmware-qca9984=m

rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

/sbin/sysctl -w net.core.rmem_max=2500000

# move nss cores to cpu1 and cpu2
i=1
awk '$7=="nss"{gsub(":","");print $1,$7}' /proc/interrupts| while read num irq; do
  echo $i > /proc/irq/$num/smp_affinity
  i=$((i+1))
done

# move rpm, and usb to cpu2
awk '$7~/qcom_rpm_ack|xhci-hcd/{gsub(":","");print $1,$7}' /proc/interrupts| while read num irq; do
  echo 2 > /proc/irq/$num/smp_affinity
done

#
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor

# NSS 
echo 800000000 > /proc/sys/dev/nss/clock/current_freq

# DISABLE IPV6
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
echo 0 > /proc/sys/net/ipv6/conf/default/forwarding

# hard limit on the number of packets in the fq_codel queue 
# default is 8192, this seems a bit excessive 
echo fq_limit 1000 >/sys/kernel/debug/ieee80211/phy0/aqm

# 802.11 CoDeL
# 5 seems a bit to agressive sometimes, more testing needed
iw phy0 set codel target 7
iw phy0 set codel interval 50

modprobe act_nssmirred

/etc/init.d/sqm restart

exit 0

Network -> interfaces -> disable packet steering.
System -> startup -> disable packet steering

5 Likes