IPQ806x NSS Drivers

Yes, I believe so... Although, I'll admit I might have been using a mix of the drivers I found from the BR500 repo. I updated yours to use GCC 6.3.0 and a later binutils. I'll rebase, clean and try again.

I think the binaries are closed source for the drivers, but the qca-wifi kernel hooks (sorry, not sure what you'd call it) are open source. I'm basing this on what I found for the BR500 which seems to be very similar to R7800

http://git.siteview.com/gitblit/tree/BR500_openwrt.git

@qosmio if you trust what I’ve compiled do try what I’ve uploaded into my Box account. If you have access to your R7800 serial console, you can use the initramfs image to test and see if the random reboots still occurs. That way you don’t need to flash the image into your router’s flash memory.

Looks like I needed to manually purge the qca-nss-drv folders out of staging and build. Did a target/linux/clean as well and so, been up for 2 hours! Everything's running pretty smoothly. And I can hit like speeds of 968mbps on my fiber. Great work! :slight_smile:

Would be awesome if you were able to get the qca-wifi drivers working. I can finally bring this router back into commission!

Will keep testing this overnight with some heavy dl/ul tests.

@quarky Shouldnt simply passing clk_ignore_unused to bootargs tell kernel to not disable them without having to patch anything?

1 Like

Yes, that should work too.

I would recommend a ‘make clean’.

Improving WiFi performance would be my next goal. Don’t hold your breath for it tho. :grimacing:

No problem, i will probably wait until i can 2 extra units, since i want to test other stuff too.

I had done that originally, but I think I may have flashed an older image I compiled. I rebuilt everything last night and it's been up since then. However, I'm having some trouble with my WiFi. I'm getting a lot of failed TX errors and my connection seems to just drop. Ethernet seems to be fine though.

This is what I'm noticing in the logs.

[Fri Feb 22 16:37:04 2019] wlan0: NSS TX failed with error: Unknown NSS TX status
[Fri Feb 22 16:41:25 2019] wlan0: NSS TX failed with error: Unknown NSS TX status
[Fri Feb 22 16:41:25 2019] wlan0: NSS TX failed with error: Unknown NSS TX status
[Fri Feb 22 16:42:17 2019] wlan0: NSS TX failed with error: Unknown NSS TX status
[Fri Feb 22 16:42:17 2019] wlan0: NSS TX failed with error: Unknown NSS TX status
[Fri Feb 22 16:43:41 2019] wlan0: NSS TX failed with error: Unknown NSS TX status

I don’t see such error messages in my R7800 log. Are you using a different WiFi driver?

Same one as your build. This is my dmesg.

[   15.593488] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   15.593602] ath10k_pci 0001:01:00.0: enabling bus mastering
[   15.594184] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   15.730310] ath10k_pci 0001:01:00.0: Direct firmware load for ath10k/pre-cal-pci-0001:01:00.0.bin failed with error -2
[   15.730349] ath10k_pci 0001:01:00.0: Falling back to user helper
[   16.098053] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   16.098112] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1
[   16.113346] ath10k_pci 0001:01:00.0: firmware ver 10.4-3.9.0.1-00008 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast crc32 7eed6f20
[   16.137046] ath10k_pci 0001:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe<  ,,<< from ath10k/QCA9984/hw1.0/board-2.bin
[   16.137295] ath10k_pci 0001:01:00.0: board_file api 1 bmi_id N/A crc32 0afe9d9a
[   18.210186] ath10k_pci 0001:01:00.0: unable to read from the device
[   18.210213] ath10k_pci 0001:01:00.0: could not execute otp for board id check: -110
[   18.215292] ath10k_pci 0001:01:00.0: failed to get board id: -110
[   20.230193] ath10k_pci 0001:01:00.0: unable to read from the device (-110)
[   20.230216] ath10k_pci 0001:01:00.0: could not read board ext data addr (-110)
[   20.236073] ath10k_pci 0001:01:00.0: could not push board ext data (-110)
[   20.243245] ath10k_pci 0001:01:00.0: failed to download board data: -110
[   20.250126] ath10k_pci 0001:01:00.0: failed to run otp: -110
[   20.256792] ath10k_pci 0001:01:00.0: could not init core (-110)
[   20.262537] ath10k_pci 0001:01:00.0: could not probe fw (-110)

My R7800 shows the same thing in the bootlog . Odd that yours exhibit problems. My iPad seems stable connecting to both the 2G and 5G interfaces.

I’m now trying to compile the wlan-open mac80211 and ath10k drivers from the QSDK repository. Let’s see if that drivers combination solves your issue and hopefully improves the WiFi performance.

I rebuilt everything from scratch this time, even the toolchain. Let's see how it hold up!

Fingers crossed the QSDK drivers work. Hope you have some luck! I'll be keeping an eye out.

Thanks again!

Wow, you guys have done an awesome work here!
What is current status for PPPoE/IPsec/etc offloading? Do we know firmware API to control offloading?
Could drivers from QSDK be ported to trunk in terms of license etc?

PPPoE & IPSec offloading is supported by the QCA NSS drivers. My ISP uses PPPoE over 802.1Q, so I can confirm that it's working. Whether it is accelerated I can't really tell tho.

As for IPSec, my builds currently do not have all the necessary drivers to offload IPSec. I'll probably get to it later.

At the moment, I'm trying to figure out how to improve WiFi performance with the ath10k drivers. Not making much headway tho.

As for licensing, the source codes are released using GPL2 license if I'm not wrong, so it can be used freely. The closed source NSS firmware tho, I'm not sure. Getting the drivers accepted into mainline source tree tho, will be difficult IMHO.

1 Like

From a purely technical point of view, it might be possible to refactor the code to hook into the hardware-flowoffloading infrastructure, this would probably be the 'easiest' approach for mainline acceptance (the work needed to actually accomplish this however would be far from easy).

3 Likes

Have been reading up on the mac80211 and ath10k sources and also learning on the Linux network stack architecture. From what I've learnt so far, to accelerate WiFi performance using the NSS firmware, we need to push both RX/TX transmit to push/pull the network packets to the NSS firmware via the NSS drivers.

From what I've seen so far with the patches I've applied to the mac80211 driver, only outgoing WiFi traffic passes through the NSS firmware. Incoming WiFi traffic via the RX path in the mac80211 driver bypasses the NSS firmware, because the ath10k driver made use of the NAPI framework, which also implement GRO. Using NAPI forces incoming WiFi traffic to go via the slow-path. From what I understand, for the NSS ECM driver to accelerate network traffic, both RX/TX traffic have to go thru the NSS firmware.

The ath10k driver from the QSDK repository doesn't make use of NAPI, but I have problem compiling it successfully for LEDE-17.01. So kind of stuck again.

Anyone here has deep understanding of the ath10k and mac80211 code who could provide me on some pointers? Would it be possible to disable NAPI easily for the current ath10k driver?

Just got myself a new toy: the zyxel NBG6817. Where should I start to (try to) help you with your work?

Cool. Start with the .dts file for the nbg6817. I think that’s all that’s required if you use my Github sources.

Hi folks,

Happy to report minor progress on the WiFi interface front in terms of performance. I managed to improve the WiFi performance somewhat, with reduced CPU utilisation. Turns out I was using the wrong NSS driver API all along. I've checked in the changes in my GitHub repository.

Do try to compile your own firmware and report back if you do see improved WiFi performance.

My builds still taxes the Krait CPU when WiFi traffic is being processed. I'm guessing that it's due to the encryption/decryption tasks performed processing the WiFi traffic.

So my next goal is to look into that.

Have fun.

3 Likes

@drbrains did you manage to get the NSS firmware running in LEDE for the nbg6817?