Qualcommax NSS Build

Hey, this config was causing me some trouble as well. https://gist.github.com/qosmio/0a1440222df8edf9daa4eb2d4bff4c65. Tried to adapt it to my target and it didn't work.

Please try using my config which you can find here: https://github.com/starraiderx/Qualcommax_NSS_Builder/blob/main/ax3600.config

The problem that opkg doesn't work is because of a custom dist feed: https://github.com/qosmio/openwrt-ipq/commit/9c5068900457c52424cb526f0124c17797322cf0. I already contacted @qosmio to revert it as it doesn't make sense in his repo.

I'm not using ax3600, I'm using wrx36.

You can adapt it to your target.

CONFIG_TARGET_qualcommax=y
CONFIG_TARGET_qualcommax_ipq807x=y
CONFIG_TARGET_qualcommax_ipq807x_DEVICE_dynalink_dl-wrx36=y
CONFIG_ATH11K_MEM_PROFILE_1024M=y
CONFIG_NSS_MEM_PROFILE_HIGH=y
CONFIG_PACKAGE_MAC80211_NSS_REDIRECT=n

Edit: I found the culprit. It's: CONFIG_PACKAGE_kmod-qca-nss-drv-igs=y. With this removed, nssifb shows up with ip link just fine after modprobing it.

Edit 2: Having sqm enabled even after removing nss igs still boot loops the device. Even with a very minimal config of just having the essential NSS packages + qdisc

Does anyone have an idea how to debug this?

OK. Here it is, my working build config for QNAP QHora-301W.
It will need some clean up for basic config though. This one have 512MB profile set in settings although the QNAP has 1GB memory.

Thanks!

Does SQM work for you?

I didn't even try it on this device.
I used rickkdotnet/sqm-scripts-nss on my old R7800 (running NSS build based on @ACwifidude repo) for some time in the past but personally I couldn't find any difference in latency on my 1G/0.7G ISP plan. So I just left it.

If you have time, could you try please? Since currently my device is boot looping when i enable it and reboot after.

Edit: Dont bother i just ran a bufferbloat test on my system.

Guess there is no need for SQM anyway :man_shrugging:

1 Like

You shouldn't need to modprobe and load the nss-ifb manually, this is handled in the nss-rk.qos script already.

This is a known bug where (after a booting up) nss qdisc shaping starts before a WAN IP is acquired. The workaround is to ensure /etc/init.d/sqm is disabled, and run it manually after some delay. However, the problem will return if you make any changes to SQM through LuCI because it reenables the SQM script.

The long term solution really is to make the change in /usr/lib/sqm/nss-rk.qos. It's on my todo...

EDIT: Expedited that todo... Just added a function to check for a WAN IP before starting. Updated on my fork:

3 Likes

Hi boys,

This version does not include NSS offload for WiFi

I am redo the repos over the latest commit from OpenWRT.

Changelog (include upstream of OpenWRT):

  • Updated kernel and NSS code to 6.1.77
  • Rollback to wpad-wolfssl and openvpn-wolfssl

Notes:

Sources:

BUILDED: https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-2024-02-17-0133 ](https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-2024-02-17-0133)

NOTE: Now I am only compiling for the AX3600, AX6 and AX9000 and Dynalink DL-WRX36 and Buffalo WXR-5950AX12 and QNAP QHora-301W devices and Netgear RAX120v2, if anyone has used my versions with other devices, tell me and I will add them again.

Regards, Agustin

1 Like

Hi boys,

This version include NSS offload for WiFi

I am redo the repos over the latest commit from OpenWRT.

Changelog (include upstream of OpenWRT):

  • Updated kernel and NSS code to 6.1.78
  • Added NSS for WiFI, thanks to @qosmio :slight_smile:
  • Added two packages to the build: luci-mod-rpc and luci-proto-gre at the request of the community.

Notes:

Sources:

BUILDED: https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-nsswifi-2024-02-18-2351 ](https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-nsswifi-2024-02-18-2351)

NOTE: Now I am only compiling for the AX3600, AX6 and AX9000 and Dynalink DL-WRX36 and Buffalo WXR-5950AX12 and QNAP QHora-301W devices and Netgear RAX120v2, if anyone has used my versions with other devices, tell me and I will add them again.

Regards, Agustin

3 Likes

Hi @doveki

Thanks for the notice, that's right all my devices are connected with WPA2/WPA3 without any problem.

Model: Xiaomi AX3600
Devices: Oneplus 8T + Samsung Galaxy A54 + Intel AX210

Regards, Agustin

1 Like

UPDATE: I hadn't noticed before, but nss-firmware, qca-nss-cfi, and qca-nss-crypto were being kept in the main tree, when they should've been in the nss_packages feed.

They were originally kept separately in my NSS-11.2-K5.15 branch. I just assumed the work on ipq807x had included them.

I've moved them back into the nss packages repository. I want to keep the NSS fork as vanilla as possible.

This will break builds if you haven't cleaned out the tmp files.

Clean up steps (after pulling from qualcommax-6.1-nss-wifi)

rm tmp/info/.packageinfo-*
./scripts/feeds update
./scripts/feeds install -p nss_packages -f -a

You'll notice a warning at first, but should properly reinstall from the new location:

WARNING: Makefile 'package/kernel/mac80211/Makefile' has a dependency on 'kmod-qca-nss-drv', which does not exist
WARNING: Makefile 'package/kernel/mac80211/Makefile' has a dependency on 'kmod-qca-nss-drv-wifi-meshmgr', which does not exist
WARNING: Makefile 'package/kernel/mac80211/Makefile' has a dependency on 'kmod-qca-nss-drv', which does not exist
WARNING: Makefile 'package/feeds/nss/qca-nss-eip/Makefile' has a dependency on 'kmod-qca-nss-ecm', which does not exist
WARNING: Makefile 'package/feeds/sqm_scripts_nss/sqm-scripts-nss/Makefile' has a dependency on 'kmod-qca-nss-drv-qdisc', which does not exist
WARNING: Makefile 'package/feeds/sqm_scripts_nss/sqm-scripts-nss/Makefile' has a dependency on 'kmod-qca-nss-drv-igs', which does not exist
Installing all packages from feed nss_packages.
Installing package 'libnl-nss' from nss_packages
Installing package 'qca-nss-clients' from nss_packages
Installing package 'qca-nss-drv' from nss_packages
Installing package 'nss-firmware' from nss_packages
Installing package 'qca-nss-cfi' from nss_packages
Installing package 'qca-nss-crypto' from nss_packages
Installing package 'nss-ifb' from nss_packages
Installing package 'nssinfo' from nss_packages
Installing package 'qca-mcs' from nss_packages
Installing package 'qca-nss-ecm' from nss_packages
Installing package 'qca-nss-macsec' from nss_packages
Installing package 'qca-ssdk-shell' from nss_packages
1 Like

Maybe we can use qca-nss-drv-igs.
I find how to use it:

ip link add name ifb-wan type ifb
ip link set dev ifb-wan up
tc qdisc add dev wan handle ffff: ingress
tc filter add dev wan parent ffff: protocol all u32 match u32 0 0 action nssmirred redirect dev ifb-wan fromdev wan
tc qdisc add dev ifb-wan root handle 1: nsstbl burst 116886 rate 940Mbit mtu 1518 accel_mode 0
tc qdisc add dev ifb-wan parent 1: handle 10: nssfq_codel limit 7740 flows 1024 quantum 1518 target 5ms interval 100ms set_default accel_mode 0

This is my config for a 1 Gbit base on sqm-scripts-nss.

The important thing is accel_mode, There have two accel_mode for qdisc
0 is to nss, 1 is to ppe, The ifb must use mode 0. Then, I get this:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< IGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
________________________________________________________________________________

0. nss interface id=44, netdevice=ifb-wan
        igs[0]_rx_pkts           = 124             common
        igs[0]_rx_byts           = 48173           common
        igs[0]_tx_pkts           = 90              common
        igs[0]_tx_byts           = 44036           common
        igs[0]_rx_queue[0]_drops = 0               drop
        igs[0]_rx_queue[1]_drops = 0               drop
        igs[0]_rx_queue[2]_drops = 0               drop
        igs[0]_rx_queue[3]_drops = 0               drop

#igs exception stats start

        igs[0]_igs_shaper_tx_drop                  = 0               drop
        igs[0]_igs_shaper_drop                     = 0               drop
        igs[0]_igs_exception_ipv4_parse_fail       = 0               exception
        igs[0]_igs_exception_ipv4_unknown_gre_type = 0               exception
        igs[0]_igs_exception_ipv4_unknown_l4       = 1               exception
        igs[0]_igs_exception_ipv4_no_cme           = 4               exception
        igs[0]_igs_exception_ipv4_frag_initial     = 0               exception
        igs[0]_igs_exception_ipv4_frag_non_initial = 0               exception
        igs[0]_igs_exception_ipv4_malformed_udp    = 0               exception
        igs[0]_igs_exception_ipv4_malformed_tcp    = 0               exception
        igs[0]_igs_exception_ipv4_malformed_udpl   = 0               exception
        igs[0]_igs_exception_ipv4_malformed_gre    = 0               exception
        igs[0]_igs_exception_ipv6_parse_fail       = 0               exception
        igs[0]_igs_exception_ipv6_unknown_l4       = 1               exception
        igs[0]_igs_exception_ipv6_no_cme           = 1               exception
        igs[0]_igs_exception_ipv6_frag_initial     = 0               exception
        igs[0]_igs_exception_ipv6_frag_non_initial = 0               exception
        igs[0]_igs_exception_ipv6_malformed_udp    = 0               exception
        igs[0]_igs_exception_ipv6_malformed_tcp    = 0               exception
        igs[0]_igs_exception_ipv6_malformed_udpl   = 0               exception
        igs[0]_igs_exception_ipv6_malformed_frag   = 0               exception
        igs[0]_igs_exception_event_no_si           = 0               exception
        igs[0]_igs_exception_eth_parse_fail        = 0               exception
        igs[0]_igs_exception_eth_unknown_type      = 3               exception
        igs[0]_igs_exception_pppoe_non_ip          = 24              exception
        igs[0]_igs_exception_pppoe_malformed       = 0               exception

Maybe, we need modify sqm-scripts-nss to use qca-nss-drv-igs.

1 Like

@qosmio CONFIG_NSS_DRV_MAPT_ENABLE=y does not enable CONFIG_PACKAGE_kmod-qca-nss-drv-map-t currently. Isnt the kmod necessary?

And i think CONFIG_PACKAGE_kmod-qca-nss-drv-clmapmgr should also be enabled when CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe is enabled, since a PPP link requires clamping.

@qosimo curious if this tree would be viable for a Yuncore AX1750 also ? hk09 ipq6018 ? i have a qualcomm dts and bdf files from yuncore

I noticed that firewall hardware offloading is needed when using CONFIG_PACKAGE_kmod-qca-nss-drv-match=y otherwise the performance will be horrible. e.g. 6000ms for dns redirection to another dns server

Added it to my readme:

It's the other way around. kmod-qca-nss-drv-* are client modules that enforce symbol dependencies in qca-nss-drv

Not sure what you mean by this. Flow offload? You don't want to enable that AT ALL. It will conflict with NSS.

Also, most of the clients packages haven't been updated upstream in years... Lord knows if they actually work or not. I've just been tidying up the build process. If you find anything that improves, please open a pull request :slight_smile:.

Yes, it's one of my goals and why I added that module back as a dependency. igs wasn't available in ipq806x, and so the nssifb module was created

Was hoping to use the act_nssmirred (igs package), and kernel ifb to do ingress as that's native to the ipq807x NSS platform.

My tc knowledge is pretty limited, but this was roughly what I tried, but wasn't getting internet. Will try this on my build. Thanks!

1 Like

It's worth a shot. I made some significant changes to the way NSS firmware is handled, so as to account ipq807x, ipq6018, and ipq5018.

Do note, some patches will need to be update because they assume IPQ807x, when in fact IPQ60xx would be supported. I don't have any boards to test it on, so any help is appreciated.