Adding OpenWrt support for Xiaomi AX3600 (Part 1)

If you have a specific link where the issue presents itself, I can give it a try.

My goto test was the ubuntu iso download:

$ wget https://cdimage.ubuntu.com/ubuntu-server/daily-live/20210628/impish-live-server-amd64.iso

PS: I think they have some rate-limitting so don't try too many times or you will have to wait.

It works OK on my end. I also received a link from @perceival , that also worked fine.

@hgblob

OK, so I went ahead and built your "ax3600" branch. Uptime: little more than an hour, and I only have 78MB free memory left. With two wireless clients.

So ath11k is still leaking, massively.

What's your build config look like?

Can you try to sysupgrade with this build because it's been going 4 days strong for me now. ~30 clients.

Also are you running just an AP or full router?

I use this little script to fix the roaming issue between switch port <-> cpu port.
For usage with busybox, it has to be adjusted a bit since it's written for bash. It depends on the qca-ssdk-shell package.

#!/bin/bash
function flush() {
	ssdk_sh fdb entry flush 1
}

IFS=$'\n'
logread -f | while read line; do
	if [[ "$line" == *"AP-STA-"* ]]; then
		flush </dev/null >/dev/null 2>&1 &
	fi
done
6 Likes

it seems the mi AX9000 has a USB, and it used IPQ8072A
and mi AX3600 is using IPQ8071A
they all belongs to IPQ807x
I suspect they have the same pin out, so if we could trace the USB pin in AX9000, we might find the USB pin in AX3600

1 Like

Sure, but all ipq807x chips have 772 pins (well, balls), on a 21*21 mm FCBGA chip, sitting on a 6-layer PCB. Unless you can find an unpopulated USB header on the PCB (you won't on the ax3600), it's very hard to trace the required pins/ lanes (even less likely if you want to do that non-destructively).

But all of this is totally unrelated to adding OpenWrt support to the ax3600 (or other ipq807x based devices), so please take this aspect to a different topic.

3 Likes

I am using it as a full router. Checked your configs and there is no difference in them, at least compared to the required drivers and modules.

The memory leak happens when there is little wireless activity or no devices connected to the AP. In fact, with 30 connected devices you are far less likely to experience the full severity of these issues even without patches. Therefore, to validate the memory leak patches you should disconnect all devices and letting the AP idle for a while (e.g., do a few iperf runs then disconnect all devices from the wireless).

1 Like

looks promising, but my opkg cannot find the package qca-ssdk-shell?

I've built it from https://github.com/robimarko/nss-packages.git . Maybe you just have to enable the package to be built. Take a look at your .config:

grep qca-ssdk-shell .config
CONFIG_PACKAGE_qca-ssdk-shell=y

1 Like

SSDK shell is an app, you can simply select it via menuconfig.

Also, @avalentin this would confirm my hunch that FDB is not being updated and you have duplicate entries and then the switch stops forwarding.
This is either a bug in SSDK or its meant to be handled via NSS bridge client etc.

2 Likes

Thanks a lot!

The script is now doing miracles here :smile:

My .config did not have such an entry. I had to clone the repo and put it in my local package feed. Then it appeared in menuconfig and the package compiled and installed just fine.

Your script needed just a very minor tweak: get rid of the b of bash.

Roaming is not an issue anymore. Of course, it is just a workaround, but hey...

Not "formaly" tested the roaming with my logging roamer ESP32 or by sending raw ethernet frames between the hosts to compare to earlier results, but normal roaming feel with a phone or notebook is just fine now for a few hours.

I did not change anything in the firmware, settings or usage pattern. Just added the script to /etc/rc.local and rebooted both APs
Since then I notice the free memory is about 10-20% higher on average and the usage curve is much more flat.

Well I guess the conclusion here is that with the same code we have completely different results:

  • the ax3600 branch I have been using for more than a week, no signs of leaks in ath11k compared to before, with > 20 stations connected on 5Ghz and 2,4Ghz max mem usage is around 60%
  • the packet corruption issues might or might not be related to you using PPoE and the rest of us not, this I think is the only difference between our setups

you need to consider that the leak is triggered with low wifi usage...
And here i see exactly this:

  • having 2 poor device wifi leaks
  • having 20 device doing nothing wifi is on load since they need to coordinate for band/freq usage and ath11k doesn't leak

About pppoe could be that there is some problem with the offload patch (if used) or nss is doing some magic with some special packet

AX3600: How to switch between booting from rootfs and roofs_1 after installing OpenWrt' branch AX3600-5.10-restart ?
Installed the .ubi OpenWrt image from a cleaned-up 3.0.22-INT version of original firmware, using the 'ubiformat' command followed by 'nvram set flag_ota_reboot=1' 'nvram commit' and 'reboot'.
That homebrew OpenWrt boots fine and appears stable but lacks the 'nvram' command to set that flag and make the next boot be done from the alternative rootfs. Modified the Makefile of the nvram package such that it got compiled for a ipq807x but it complaints: 'Could not open nvram!'
Somebody on this forum thread that can shine some light on whether having an alternative rootfs available is supposed to remain supported?
If it is supposed to be possible to switch, how to control this from userspace?

You just need to set the right index in both variables:

fw_setenv flag_last_success 0
fw_setenv flag_boot_rootfs 0
1 Like

Thank you Vitor!