Replicating my build from scratch:
Master:
git clone -b kernel5.10-nss-qsdk10.0 https://github.com/ACwifidude/openwrt.git
Openwrt 22.03:
git clone -b openwrt-22.03-nss-qsdk10.0 https://github.com/ACwifidude/openwrt.git
Openwrt 21.02:
git clone -b openwrt-21.02-nss-qsdk10.0 https://github.com/ACwifidude/openwrt.git
This is my diffconfig. Feel free to edit my diffconfig to your needs:
# 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=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_linksys_ea8500=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_linksys_ea8500=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_linksys_ea7500-v1=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_linksys_ea7500-v1=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_tplink_c2600=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_tplink_c2600=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_r7500=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_netgear_r7500=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_r7500v2=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_netgear_r7500v2=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_zyxel_nbg6817=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_zyxek_nbg6817=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_asrock_g10=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_asrock_g10=""
CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_d7800=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_netgear_d7800=""
CONFIG_ALL_KMODS=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
# exfat is patented
CONFIG_BUILD_PATENTED=y
# NSS Drivers
CONFIG_PACKAGE_kmod-qca-nss-drv=y
CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc=y
CONFIG_PACKAGE_kmod-qca-nss-ecm-standard=y
CONFIG_PACKAGE_kmod-qca-nss-gmac=y
CONFIG_PACKAGE_kmod-nss-ifb=y
CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe=y
CONFIG_PACKAGE_MAC80211_NSS_SUPPORT=y
# CONFIG_PACKAGE_kmod-qca-nss-cfi-cryptoapi is not set
# CONFIG_PACKAGE_kmod-qca-nss-crypto is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-capwapmgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-gre is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2 is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-lag-mgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-map-t is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-pptp is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-profile is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6 is not set
# CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr is not set
# CONFIG_PACKAGE_kmod-qca-nss-ecm-noload is not set
# CONFIG_PACKAGE_kmod-qca-nss-ecm-premium is not set
# CONFIG_PACKAGE_kmod-qca-nss-ecm-premium-noload 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_PACKAGE_irqbalance=y
CONFIG_DROPBEAR_ECC=y
CONFIG_PACKAGE_openvpn-openssl=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_kmod-cryptodev=y
CONFIG_PACKAGE_libopenssl-devcrypto=y
CONFIG_PACKAGE_iptables-mod-physdev=y
CONFIG_PACKAGE_kmod-ipt-physdev=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-cifs=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-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_kmod-fs-xfs=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_ntfs-3g=y
# IPv6 support
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6to4=y
CONFIG_PACKAGE_6rd=y
# IPv6 NAT support (ip6tables NAT extensions, ipt-nat6 and nf-nat6 kmods)
CONFIG_PACKAGE_ip6tables-mod-nat=y
# WLAN/WPS support
CONFIG_PACKAGE_hostapd-utils=y
CONFIG_WPA_MSG_MIN_PRIORITY=4
CONFIG_PACKAGE_wpad-openssl=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
# CONFIG_PACKAGE_libustream-wolfssl is not set
# SSL certificates
CONFIG_PACKAGE_ca-certificates=y
# Luci (SSL from OpenSSL)
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-app-commands=y
CONFIG_PACKAGE_luci-app-sqm=y
CONFIG_PACKAGE_luci-app-adblock=y
CONFIG_PACKAGE_luci-app-openvpn=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-wireguard=y
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
CONFIG_PACKAGE_luci-app-bcp38=y
CONFIG_PACKAGE_luci-app-banip=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-interface=y
CONFIG_PACKAGE_collectd-mod-iwinfo=y
CONFIG_PACKAGE_collectd-mod-load=y
CONFIG_PACKAGE_collectd-mod-memory=y
CONFIG_PACKAGE_collectd-mod-network=y
CONFIG_PACKAGE_collectd-mod-ping=y
CONFIG_PACKAGE_collectd-mod-sqm=y
CONFIG_PACKAGE_collectd-mod-thermal=y
CONFIG_PACKAGE_collectd-mod-wireless=y
CONFIG_PACKAGE_collectd-mod-uptime=y
# nlbwmon app
CONFIG_PACKAGE_luci-app-nlbwmon=y
Change the first section of the diffconfig to just one device if you are building for a particular model (r7800 as the example):
# Use "make defconfig" to expand this to a full .config
CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_ipq806x_generic=y
CONFIG_TARGET_ipq806x_generic_DEVICE_netgear_r7800=y
My diffconfig file is set up for ath10k-ct driver/firmware. If you want to use ath10k driver/firmware instead - use the diffconfig-ath10k file.
When your diffconfig is to your liking - this is how to prep and build (I have a 4 CPU system, change the last line to the number of CPUs in your system):
./scripts/feeds update -a && ./scripts/feeds install -a && cp diffconfig .config && make defconfig && ./scripts/getver.sh
make -j5
Rebasing with Master, OpenWrt 22.03, or OpenWrt 21.02 (make sure you are in the openwrt folder, rebase with the latest updates - then you can build as per above)
#Remove “rebase” commit (this gives you a clean build environment - it deletes the final bin content and diffconfig files, I’d copy the diffconfig to a separate folder before running this command)
git reset --hard HEAD~1
git remote add upstream https://git.openwrt.org/openwrt/openwrt.git
#Master Rebase:
git fetch upstream && git rebase upstream/master
#OpenWrt 22.03 Rebase:
git fetch upstream && git rebase upstream/openwrt-22.03
#OpenWrt 21.02 Rebase:
git fetch upstream && git rebase upstream/openwrt-21.02
Recommended configuration (build is the master defaults (CPU has been further optimized as per below), you’ll have to do all the rest yourself):
- Firewall Software & Hardware offloading disabled
- Use the default ondemand optimized settings:
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 600000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
(or switch to the performance governor)
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor; echo performance > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
- Irqbalance and packet steering enabled
uci set irqbalance.irqbalance.enabled=1; uci set network.globals.packet_steering=1; uci commit
- Custom NSS fq_codel startup script if SQM is desired (below is set to 900/900). Recommend setting to 5% below your ISP provided speed and then adjusting from there as per your testing. Maximum is ~900Mbit.
modprobe nss-ifb
ip link set up nssifb
# Shape ingress traffic to 900 Mbit with chained NSSFQ_CODEL
tc qdisc add dev nssifb root handle 1: nsstbl rate 900Mbit burst 1Mb
tc qdisc add dev nssifb parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default
# Shape egress traffic to 900 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 900Mbit burst 1Mb
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default
- 802.11v,k enabled on 5ghz radio (change to your timezone)
wireless settings
uci set wireless.default_radio0.ieee80211v=1; uci set wireless.default_radio0.ieee80211k=1; uci set wireless.default_radio0.bss_transition=1; uci set wireless.default_radio0.wnm_sleep_mode=1; uci set wireless.default_radio0.time_advertisement=2; uci set wireless.default_radio0.time_zone=CST6CDT,M3.2.0,M11.1.0; uci commit
dawn settings (if you want to add dawn)
uci add_list umdns.@umdns[0].network='wan'; uci set dawn.@metric[0].ht_support='10'; uci set dawn.@metric[0].vht_support='100'; uci set dawn.@metric[0].min_probe_count='2'; uci commit
- Make custom DNS internal sites work (if you have custom sites):
ifconfig br-lan promisc
turn custom internal sites off:
ifconfig br-lan -promisc
- kmods don’t install like normal on this build. Here is a full listing of packages available for install:
MasterNSS builds:
MasterNSS-ath10k builds:
Example install of a package-
opkg install https://github.com/ACwifidude/openwrt/raw/kernel5.10-nss-qsdk10.0/bin/targets/ipq806x/generic/packages-MasterNSS/kmod-bluetooth_5.10.107-1_arm_cortex-a15_neon-vfpv4.ipk
- Want Ath10k instead of Ath10k-ct?
Load the ath10k version to get both the driver and firmware. If you want to just change the firmware you can switch like this:
opkg update && opkg remove ath10k-firmware-qca9984-ct && opkg install ath10k-firmware-qca9984
- Looking for more of a minimalist / no frills build with the minimum active services running?
Add this script to your startup script on your router to disable “extra” services:
# these services do not run on the router
for i in bcp38 adblock banip openvpn sqm; do
if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
/etc/init.d/"$i" stop
fi
done
Add this script to your startup script on your dumb Access Point(s), NOT YOUR MAIN ROUTER - this disables the firewall!!!! to disable “extra” services:
# these services do not run on dumb APs
for i in firewall dnsmasq odhcpd bcp38 adblock banip openvpn ddns sqm; do
if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
/etc/init.d/"$i" stop
fi
done
Wireless Performance: (with the above settings on a R7800 using an iphone 2x2 client)
ath10k-ct, 5.10 Kernel with NSS Hardware Offloading
[SUM] 0.00-30.01 sec 2.30 GBytes 659 Mbits/sec receiver
[SUM] 0.00-30.01 sec 1.99 GBytes 569 Mbits/sec 189 sender
ath10k (OpenWrt with no offloading)
[SUM] 0.00-30.01 sec 1.60 GBytes 459 Mbits/sec receiver
[SUM] 0.00-30.01 sec 1.14 GBytes 326 Mbits/sec 699 sender
ath10k-ct (OpenWrt with no offloading)
[SUM] 0.00-30.01 sec 1.53 GBytes 437 Mbits/sec receiver
[SUM] 0.00-30.01 sec 1.21 GBytes 347 Mbits/sec 763 sender