Qualcommax NSS Build

That's great news, and you came further than me, and you have different error. :smile:
I'll have a look at your branch and see what I'm missing.

I think I had that peer not found for nss peer delete earlier but fixed it. But can't remember what changes. Might be that ansuel's patches was a little different compared to the qca pathes on the peer stuff.

But good work and keep us posted :+1:

1 Like

great work @qosmio just for my reference from which qsdk branch you refactored the patches from ?

also do you see any stats flowing
/sys/kernel/debug/qca-nss-drv/stats/wifi
/sys/kernel/debug/qca-nss-drv/stats/wifili

?

thank you

Guys which repo can be use to start testing NSS build?

Thanks! Haven't messed with any of this stuff in over a year, but awesome to see everyone continuing some of the work I did for ipq806x work over to ipq807x :slight_smile:

And I'm pulling from NHSS.QDSK.12.4.5.r3 branch

/sys/kernel/debug/qca-nss-drv/stats/wifi is mostly for ipq086x platform, so all the stats show "0".

ipq807x uses the "wifili" API.

➤ grep -Ev "^$" /sys/kernel/debug/qca-nss-drv/stats/wifili
________________________________________________________________________________
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< INTERNAL: UNKNOWN >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
________________________________________________________________________________
________________________________________________________________________________
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< PDEV 0 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
________________________________________________________________________________
#txrx
	wifili[0]_rx_msdu_error                 = 0               error
	wifili[0]_rx_inv_peer_rcv               = 0               special
	wifili[0]_rx_wds_srcport_exception      = 0               exception
	wifili[0]_rx_wds_srcport_exception_fail = 0               drop
	wifili[0]_rx_deliverd                   = 2887479         special
	wifili[0]_rx_deliver_drops              = 0               drop
	wifili[0]_rx_intra_bss_ucast            = 0               special
	wifili[0]_rx_intra_bss_ucast_fail       = 0               drop
	wifili[0]_rx_intra_bss_mcast            = 0               special
	wifili[0]_rx_intra_bss_mcast_fail       = 0               drop
	wifili[0]_rx_sg_rcv_send                = 0               special
	wifili[0]_rx_sg_rcv_fail                = 0               drop
	wifili[0]_rx_mcast_echo                 = 0               special
	wifili[0]_rx_inv_tid                    = 0               special
	wifili[0]_stats_rx_frag_inv_sc          = 0               special
	wifili[0]_stats_rx_frag_inv_fc          = 0               special
	wifili[0]_stats_rx_frag_non_frag        = 0               special
	wifili[0]_stats_rx_frag_retry           = 0               special
	wifili[0]_stats_rx_frag_ooo             = 0               special
	wifili[0]_stats_rx_frag_ooo_seq         = 0               special
	wifili[0]_stats_rx_frag_all_frag_rcv    = 0               special
	wifili[0]_stats_rx_frag_deliver         = 0               special
	wifili[0]_tx_enqueue                    = 16249667        special
	wifili[0]_tx_enqueue_drop               = 0               drop
	wifili[0]_tx_dequeue                    = 16249667        special
	wifili[0]_tx_hw_enqueue_fail            = 0               drop
	wifili[0]_tx_sent_count                 = 16249667        special
#tcl ring
	wifili[0]_tcl_no_hw_desc = 0               special
	wifili[0]_tcl_ring_full  = 0               special
	wifili[0]_tcl_ring_sent  = 16249654        special
#tcl comp
	wifili[0]_tx_desc_free_inv_bufsrc       = 0               error
	wifili[0]_tx_desc_free_inv_cookie       = 0               special
	wifili[0]_tx_desc_free_hw_ring_empty    = 0               special
	wifili[0]_tx_desc_free_reaped           = 16249593        special
	wifili[0]_tx_capture_enqueue_count      = 0               special
	wifili[0]_tx_capture_enqueue_fail_count = 0               error
#reo ring
	wifili[0]_reo_error          = 0               error
	wifili[0]_reo_reaped         = 2887455         special
	wifili[0]_reo_inv_cookie     = 0               special
	wifili[0]_stats_reo_frag_rcv = 0               special
#tx sw pool
	wifili[0]_tx_desc_in_use            = 84              special
	wifili[0]_tx_desc_alloc_fail        = 0               special
	wifili[0]_tx_desc_already_allocated = 0               special
	wifili[0]_tx_desc_invalid_free      = 0               special
	wifili[0]_tx_desc_free_src_fw       = 13769           special
	wifili[0]_tx_desc_free_completion   = 16235529        special
	wifili[0]_tx_desc_no_pb             = 0               special
	wifili[0]_tx_desc_queuelimit_drop   = 0               drop
#tx ext sw pool
	wifili[0]_ext_tx_desc_in_use            = 0               special
	wifili[0]_ext_tx_desc_alloc_fail        = 0               special
	wifili[0]_ext_tx_desc_already_allocated = 0               special
	wifili[0]_ext_tx_desc_invalid_free      = 0               special
#rxdma pool
	wifili[0]_rx_desc_no_pb      = 12737886        special
	wifili[0]_rx_desc_alloc_fail = 0               special
	wifili[0]_rx_desc_in_use     = 4095            special
#rxdma ring
	wifili[0]_rxdma_hw_desc_unavailable = 0               special
	wifili[0]_rxdma_buf_replenished     = 2891690         special
________________________________________________________________________________
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< PDEV 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
________________________________________________________________________________
#txrx
	wifili[1]_rx_msdu_error                 = 0               error
	wifili[1]_rx_inv_peer_rcv               = 0               special
	wifili[1]_rx_wds_srcport_exception      = 0               exception
	wifili[1]_rx_wds_srcport_exception_fail = 0               drop
	wifili[1]_rx_deliverd                   = 33739           special
	wifili[1]_rx_deliver_drops              = 0               drop
	wifili[1]_rx_intra_bss_ucast            = 0               special
	wifili[1]_rx_intra_bss_ucast_fail       = 0               drop
	wifili[1]_rx_intra_bss_mcast            = 0               special
	wifili[1]_rx_intra_bss_mcast_fail       = 0               drop
	wifili[1]_rx_sg_rcv_send                = 0               special
	wifili[1]_rx_sg_rcv_fail                = 0               drop
	wifili[1]_rx_mcast_echo                 = 0               special
	wifili[1]_rx_inv_tid                    = 0               special
	wifili[1]_stats_rx_frag_inv_sc          = 0               special
	wifili[1]_stats_rx_frag_inv_fc          = 0               special
	wifili[1]_stats_rx_frag_non_frag        = 0               special
	wifili[1]_stats_rx_frag_retry           = 0               special
	wifili[1]_stats_rx_frag_ooo             = 0               special
	wifili[1]_stats_rx_frag_ooo_seq         = 0               special
	wifili[1]_stats_rx_frag_all_frag_rcv    = 0               special
	wifili[1]_stats_rx_frag_deliver         = 0               special
	wifili[1]_tx_enqueue                    = 44859           special
	wifili[1]_tx_enqueue_drop               = 0               drop
	wifili[1]_tx_dequeue                    = 44859           special
	wifili[1]_tx_hw_enqueue_fail            = 0               drop
	wifili[1]_tx_sent_count                 = 44859           special
#tcl ring
	wifili[1]_tcl_no_hw_desc = 0               special
	wifili[1]_tcl_ring_full  = 0               special
	wifili[1]_tcl_ring_sent  = 44859           special
#tcl comp
	wifili[1]_tx_desc_free_inv_bufsrc       = 0               error
	wifili[1]_tx_desc_free_inv_cookie       = 0               special
	wifili[1]_tx_desc_free_hw_ring_empty    = 0               special
	wifili[1]_tx_desc_free_reaped           = 46160           special
	wifili[1]_tx_capture_enqueue_count      = 0               special
	wifili[1]_tx_capture_enqueue_fail_count = 0               error
#reo ring
	wifili[1]_reo_error          = 0               error
	wifili[1]_reo_reaped         = 33703           special
	wifili[1]_reo_inv_cookie     = 0               special
	wifili[1]_stats_reo_frag_rcv = 0               special
#tx sw pool
	wifili[1]_tx_desc_in_use            = 0               special
	wifili[1]_tx_desc_alloc_fail        = 0               special
	wifili[1]_tx_desc_already_allocated = 0               special
	wifili[1]_tx_desc_invalid_free      = 0               special
	wifili[1]_tx_desc_free_src_fw       = 15036           special
	wifili[1]_tx_desc_free_completion   = 29823           special
	wifili[1]_tx_desc_no_pb             = 0               special
	wifili[1]_tx_desc_queuelimit_drop   = 0               drop
#tx ext sw pool
	wifili[1]_ext_tx_desc_in_use            = 0               special
	wifili[1]_ext_tx_desc_alloc_fail        = 0               special
	wifili[1]_ext_tx_desc_already_allocated = 0               special
	wifili[1]_ext_tx_desc_invalid_free      = 0               special
#rxdma pool
	wifili[1]_rx_desc_no_pb      = 0               special
	wifili[1]_rx_desc_alloc_fail = 0               special
	wifili[1]_rx_desc_in_use     = 0               special
#rxdma ring
	wifili[1]_rxdma_hw_desc_unavailable = 0               special
	wifili[1]_rxdma_buf_replenished     = 39099           special
________________________________________________________________________________
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< PDEV 2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
________________________________________________________________________________
#txrx
	wifili[2]_rx_msdu_error                 = 0               error
	wifili[2]_rx_inv_peer_rcv               = 0               special
	wifili[2]_rx_wds_srcport_exception      = 0               exception
	wifili[2]_rx_wds_srcport_exception_fail = 0               drop
	wifili[2]_rx_deliverd                   = 0               special
	wifili[2]_rx_deliver_drops              = 0               drop
	wifili[2]_rx_intra_bss_ucast            = 0               special
	wifili[2]_rx_intra_bss_ucast_fail       = 0               drop
	wifili[2]_rx_intra_bss_mcast            = 0               special
	wifili[2]_rx_intra_bss_mcast_fail       = 0               drop
	wifili[2]_rx_sg_rcv_send                = 0               special
	wifili[2]_rx_sg_rcv_fail                = 0               drop
	wifili[2]_rx_mcast_echo                 = 0               special
	wifili[2]_rx_inv_tid                    = 0               special
	wifili[2]_stats_rx_frag_inv_sc          = 0               special
	wifili[2]_stats_rx_frag_inv_fc          = 0               special
	wifili[2]_stats_rx_frag_non_frag        = 0               special
	wifili[2]_stats_rx_frag_retry           = 0               special
	wifili[2]_stats_rx_frag_ooo             = 0               special
	wifili[2]_stats_rx_frag_ooo_seq         = 0               special
	wifili[2]_stats_rx_frag_all_frag_rcv    = 0               special
	wifili[2]_stats_rx_frag_deliver         = 0               special
	wifili[2]_tx_enqueue                    = 0               special
	wifili[2]_tx_enqueue_drop               = 0               drop
	wifili[2]_tx_dequeue                    = 0               special
	wifili[2]_tx_hw_enqueue_fail            = 0               drop
	wifili[2]_tx_sent_count                 = 0               special
#tcl ring
	wifili[2]_tcl_no_hw_desc = 0               special
	wifili[2]_tcl_ring_full  = 0               special
	wifili[2]_tcl_ring_sent  = 0               special
#tcl comp
	wifili[2]_tx_desc_free_inv_bufsrc       = 0               error
	wifili[2]_tx_desc_free_inv_cookie       = 0               special
	wifili[2]_tx_desc_free_hw_ring_empty    = 0               special
	wifili[2]_tx_desc_free_reaped           = 0               special
	wifili[2]_tx_capture_enqueue_count      = 0               special
	wifili[2]_tx_capture_enqueue_fail_count = 0               error
#reo ring
	wifili[2]_reo_error          = 0               error
	wifili[2]_reo_reaped         = 0               special
	wifili[2]_reo_inv_cookie     = 0               special
	wifili[2]_stats_reo_frag_rcv = 0               special
#tx sw pool
	wifili[2]_tx_desc_in_use            = 0               special
	wifili[2]_tx_desc_alloc_fail        = 0               special
	wifili[2]_tx_desc_already_allocated = 0               special
	wifili[2]_tx_desc_invalid_free      = 0               special
	wifili[2]_tx_desc_free_src_fw       = 0               special
	wifili[2]_tx_desc_free_completion   = 0               special
	wifili[2]_tx_desc_no_pb             = 0               special
	wifili[2]_tx_desc_queuelimit_drop   = 0               drop
#tx ext sw pool
	wifili[2]_ext_tx_desc_in_use            = 0               special
	wifili[2]_ext_tx_desc_alloc_fail        = 0               special
	wifili[2]_ext_tx_desc_already_allocated = 0               special
	wifili[2]_ext_tx_desc_invalid_free      = 0               special
#rxdma pool
	wifili[2]_rx_desc_no_pb      = 509891          special
	wifili[2]_rx_desc_alloc_fail = 0               special
	wifili[2]_rx_desc_in_use     = 4095            special
#rxdma ring
	wifili[2]_rxdma_hw_desc_unavailable = 0               special
	wifili[2]_rxdma_buf_replenished     = 0               special
#wbm ring
	wifili_wbm_ie_local_alloc_fail = 0               error
	wifili_wbm_src_dma             = 382             special
	wifili_wbm_src_dma_code_inv    = 0               special
	wifili_wbm_src_reo             = 1067            special
	wifili_wbm_src_reo_code_nullq  = 165             special
	wifili_wbm_src_reo_code_inv    = 839             error
	wifili_wbm_src_inv             = 0               error
2 Likes

I mostly used the patch names vs. the content from @Ansuel's patches to pull from qsdk's 12.4.5.r3 branch. Since most of their changes are closer to backports 6.5 (6.5-rc3) vs. 5.15 (5.15.33). Hopefully it's something minor I'm missing.

1 Like

Hmm... If I remember correctly I think I had the same error using the patch code from qsdk. So I went back to use the code from ansuel. But I don't think you need to change everything, just the peer code in the 199-002-ath11k_nss-add-nss-driver-interface.patch. But have a look at the peer stuff from the ansuel patch and compare it to qsdk.

In your code https://github.com/qosmio/openwrt-ipq/blob/c3f668c2408c89567afb5f4ae04d9ab24da587f9/package/kernel/mac80211/patches/ath11k_nss/199-002-ath11k_nss-add-nss-driver-interface.patch#L1352 they do things differently.

An update from my code, more or less not working. I tried to add the patches that is working for you. But that did not help with my errors. I also see that qsdk are putting back older code OpenWrt have removed (build fix patches). But I don't wanna go backwards :smile:

And sorry for not sharing any patches. It just don't work and it's a mess. Now I'm trying to figure out what changes you did to make it work.

2 Likes

Great work!
I've compiled a version from your repo in order to test the nss wifi offloading on QNAP QHora 301W.
For 30 minutes work I've constantly got this
ath11k c000000.wifi: peer not found for nss peer delete
but most of my Wi-Fi 6 devices couldn't connect to the wifi at all.
One Samsung SmartPhone with Wi-Fi 5 connected successfully and indeed the wifi was fully offloaded reading zero CPU usage during wifi Speed Test.
I've even tried with latest firmware WLAN.HK.2.9.0.1-01890-QCAHKSWPL_SILICONZ-1, but nothing changed.
Fingers crossed that the NSS wifi offload can be added to the NSS builds too.

1 Like

but just to understand. Any build works with WiFi offloading?
I haven't understood..

thanks

no ... wifi offloading is not working .. hence the build that qosmio just posted that tries to implement wifi offloading

so compiled with qosmio build and with ath11k having nss_offload=1

and

with nss_offload=0 all works as usual

btw ... I moved to the qnap and now i am getting the nss peer delete messages ...

regarding the dynalink as I haven't been using for a while it was missing dts updates

@qosmio unsure if your build has

/etc/hotplug.d/firmware/12-ath11k_nss

with

#!/bin/sh

. /lib/functions.sh

enable_nss_offload=$(cat /sys/module/ath11k/parameters/nss_offload)

[ "$enable_nss_offload" -eq 0 ] && exit 0

board=$(board_name)

# Common queue limits
sysctl -w dev.nss.n2hcfg.n2h_queue_limit_core0=256 >/dev/null 2>/dev/null
sysctl -w dev.nss.n2hcfg.n2h_queue_limit_core1=256 >/dev/null 2>/dev/null

case "$board" in
redmi,ax6) # 256MB profile
        sysctl -w dev.nss.n2hcfg.extra_pbuf_core0=3100000 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_high_water_core0=30528 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_wifi_pool_buf=4096 >/dev/null 2>/dev/null
        ;;
edimax,cax1800|\
xiaomi,ax3600) # 512MB profile
        sysctl -w dev.nss.n2hcfg.extra_pbuf_core0=3100000 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_high_water_core0=30624 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_wifi_pool_buf=8192 >/dev/null 2>/dev/null
        ;;
edgecore,eap102|\
qnap,301w|\
dynalink,dl-wrx36|\
xiaomi,ax9000) #1G profile
        sysctl -w dev.nss.n2hcfg.extra_pbuf_core0=10000000 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_high_water_core0=72512 >/dev/null 2>/dev/null
        sysctl -w dev.nss.n2hcfg.n2h_wifi_pool_buf=36864 >/dev/null 2>/dev/null
        ;;
esac

It does, I added wrx36 to the second case function. Seemed to better stable doing that.

Thanks for the suggestions where to look, going to work on this a little more this weekend.

@sppmaster , I've noticed an odd behavior as well. If I ever switched between my 2G or 5G APs it won't let me connect at all. Something to do with password being converted PSK, a total guess. Only way it works is rebooting with old non-nss, connecting to the AP, and then rebooting back with nss on. So far it's been up 24 hours with no major issues. Just the regular "peer delete" errors I'm trying to mitigate.

2 Likes

Have you tried patch 112-wifi-ath11k-Fix-tkip-encryption-traffic-failure.patch ?

2 Likes

What performance do you get on this way? Except for the "peer delete" errors.

Thanks!

I just checked, and looks like I did apply it as part of a "piece-mealed" patch in 900-fix-build.patch but "112" is actually "359" in QSDK's patches ("359-ath11k-fix-tkip-encryption-traffic-failure.patch"). I should probably break it out into its original patch just to better track what's getting applied.

Do you mean any negative performance impact? Honestly the biggest negative is clients having reconnect issues if ever they need to be re-added (i.e. deleting the connection on the client, and re-adding with password ends up not negotiating PSK).

On the positive side, I've been able to consistently get line speed on all my WIFI 6 clients without any CPU usage being consumed at all.

1 Like

try setting on the ath11k driver crypto_mode to 1 (software only) i seem to remember the support on the nss-crypto driver is limited (to aes ? )

just ignore it ... just tried it ...is worse

What about just trying without encryption (open network) at all.

yes that should get rid of the authenc issues i guess

Today I've tried more with the nss-wifi build.
Changing wifi to open network hasn't resolved the issues because my devices couldn't get IP addresses via DHCP.
I have static leases set for all devices (they all use their default MAC addresses) but not all of them could get IP addresses via DHCP.
I then changed the wifi settings so they use randomized MACs when connecting to my wifi. In this case all devices could get new IPs from DHCP. But if a device was later disconnected from the wifi it couldn't reconnect again informing about wrong password.
After a few hours of work I started experiencing connection interruptions on devices connected via cable too.
This is what I found so far.