I’ve clankered this thing out. No idea why it works, but it’s interesting. Have a look.
Currently tested: AN7583 - MT7990 (WiFi 7), WiFi hardware forwarding is working, tunnel offload is working.
Try it on AN7553, AN7581. Pls give me UART outputs.
I’ve clankered this thing out. No idea why it works, but it’s interesting. Have a look.
Currently tested: AN7583 - MT7990 (WiFi 7), WiFi hardware forwarding is working, tunnel offload is working.
Try it on AN7553, AN7581. Pls give me UART outputs.
Benchmark report for this firmware:
TLDR: It's better, much better.
I gave your most current commit a try, seems to work well with good latency under load and unchanged speeds on AN7581 + mt7996 compared to stock firmware, impressive clankering.
However, over night, no packets were seemingly routed to WiFi clients any more although they stayed associated -- connecting to a different SSID made them work again, so some kind of issue occurs for old offloaded clients/flows.
I can't figure out how to access the NPU's UART and it dumps nothing in kernel log, I built it with MAILTRACE and NPUDBG fwiw. Reading from 0x1e906800 gives gibberish, so registers are probably different on AN7581?
Could you try the latest commit again? Emulator shows the datapath isn't matched.
But still can't explain about the timeout behaviour of your tests though... Could you elaborate again on "connecting to a different SSID made them work again"? Did you disconnect/reconnect or did you switched the band of the same AP?
UART of the NPU is shared with the host, unless the host's driver has disabled it on start-up, can you check modinfo npu and cat /etc/preinit to show how your firmware loaded it?
Or you can just throw me the rootfs squashfs image dumped from mtd, I can check it myself.
I have one mlo SSID which the device was connected to and 3 individual 2G/5G/6G SSIDs. Switching to 5G restored the connection, but this probably didn't switch the band - this is a Wifi 6 device without eMLSR, it usually associates with the 5g band.
Here is modinfo/preinit:
root@OpenWrt:~# modinfo airoha-npu
filename: /lib/modules/6.18.44/airoha_npu.ko
license: GPL
alias: of:NTCairoha,an7583-npuC*
alias: of:NTCairoha,an7583-npu
alias: of:NTCairoha,en7581-npuC*
alias: of:NTCairoha,en7581-npu
depends:
intree: Y
name: airoha_npu
vermagic: 6.18.44 SMP mod_unload aarch64
root@OpenWrt:~# cat /etc/preinit
#!/bin/sh
Copyright (C) 2006-2016 OpenWrt.org
Copyright (C) 2010 Vertical Communications
[ -z "$PREINIT" ] && exec /sbin/init
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
. /lib/functions.sh
. /lib/functions/preinit.sh
. /lib/functions/system.sh
boot_hook_init preinit_essential
boot_hook_init preinit_main
boot_hook_init failsafe
boot_hook_init initramfs
boot_hook_init preinit_mount_root
for pi_source_file in /lib/preinit/*; do
. $pi_source_file
done
boot_run_hook preinit_essential
pi_mount_skip_next=false
pi_jffs2_mount_success=false
pi_failsafe_net_message=false
boot_run_hook preinit_main
I'll pay closer attention when it happens again and if it's the same for other devices. LAN and a wireguard tunnel over the internet to the router worked fine.
I've found a lot of defects related to datapath of 7581 NPU during my emulator testing, fixing it right now. This is a blind fix because I'm currently don't have access to this SoC.
On this SoC, only the wifi traffic is going through the NPU. LAN traffics directly go to the PPE and marked for WAN forwarding.
Edit: Fixed lots of defect using simulated run of stock and src-built. Pls check it and feedback.
One thing, the QLIMIT cannot be apply on 7581 due to lack of available SRAM capacity.
Hi,
I have done a test of the binaries on Quantum Fiber w1700k (AN7581N + MT7996) - gist is available here . For now I have traceback.
Thanks for your work.
Hi,
The NPU printouts is actually on the UART, not in dmesg.
The NPU has a shared UART bus with the CPU where it could print, but the message never crossed the CPU so it cannot be found in dmesg.
Help me get the UART output from the device for further validation.
Other updates:
So from UART it is https://gist.github.com/danpawlik/3034da019a9322e1b3f5404e6c77fb10 . I'm sure I replace the binaries, but it shows the NPU version same as before. This time I poweroff for 20 seconds, then turn back and there is no traceback.
Same thing for me, I couldn't find the firmware magic at 0x1e906800 because the stock NPU firmware was loaded from ROM before the overlay file system was mounted. I built a new image with the clankered firmware replacing the binaries in airoha-en7581-npu-firmware and it loads fine into RAM with correct magic, however serial UART is entirely empty from any NPU output. Not even the stock airoha-npu 1e900000.npu: NPU fw version: 0.1111 string.
LAN offload works well with full speeds at 0% cpu but no WLAN offload at all.