Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Hm, it could be that they have not limited the channel range properly in the BDF for the IoT radio.
I have seen that before, where they would limit the channels further in SW instead of doing it properly and
then it advertises channels that are outside of the designed amplifier range.

I think this patch solves memory leak.302-ath11k-tx-mgmt-cleanup-fix.patch
after a day available memory just stays around 30% (I only have one wireless client)

and about encap offload I think we are gonna need to wait for the new firmware. They mentioned firmware WLAN.HK.2.5.0.1-00844-QCAHKSWPL-1 supports sending native wifi EAPOL frames in
ethernet mode.

3 Likes

Next time I'm back on Xiaomi firmware (TFTP recovery), I'll see what iw shows for the 1x1 radio and scan. It's still useful even for 2.4GHz, just not as an AP with range. It works well enough overall not to lock it off; disappointing but not broken!

1 Like

@castiel652 I am trying that patch and I am still seeing a leak on AX9000.
Its around 13MB over an hour of operation, after 1:30h its over 30MB of leak.

If you can apply that patch to AX3600-5.10-restart, I am happy to test it as well. Can it be, that the patch only solves the leak with t a specific firmware version? @castiel652 which WLAN FW did you tested with?

1 Like

Where exactly do you see that memory leak?

I'm using my AX9000 as a daily driver since the last week and i don't see a memory leak at all.

I would also be happy to test the memleak patch in my AX3600s, as it could solve the wifi starting acting weird after approx. 1 week (e.g., the browser in my computer starts showing occasional warnings of either broken SSL/TLS or connections resets). That issue is easily "solved" with a router reboot, and that's how I've been daily driving my AX3600s. The broken SSL/TLS usually happens without NSS, while the connections resets happen with NSS -- either way, the issues usually start within the same timeframe (only on the ath11k radio).

Can't really comment much about the IoT radio other than it works (i.e., my washer uses the 2.4Ghz legacy rates and it works).

Interested in testing the patch as well, but I'm new to applying patches to the build system. Is the following procedure correct?

  1. Place 302-ath11k-tx-mgmt-cleanup-fix.patch in package/kernel/mac80211/patches/ath11k/
  2. make package/kernel/mac80211/refresh V=s
  3. make clean and make

If so, the patch doesn't have any effect on my AX3600. Free memory drops to ~20MB after 30 minutes of uptime.

@kirdes Easily, just enable a 2G ath11k radio and leave it running.
If you have traffic periodically it will trigger cleanup and due to a 1G of RAM you most likely don't ever run completely out of RAM, but it's still leaking.

@foxium Yeah, that is right.

2 Likes

Oh well I checked and I didn't delete the other QCA patch when I was testing.

It's actually 143-ath11k-disabling-credit-flow-for-ath11k.patch.
With it available memory goes down when WiFi is up but just stays around 30%.
Without it it just keeps going lower.

But you guys said the patch doesn't really fix the leak so I am out of idea now.

OK, so we need to test 143-ath11k-disabling-credit-flow-for-ath11k.patch instead of 302-ath11k-tx-mgmt-cleanup-fix.patch , or both?

try 143-ath11k-disabling-credit-flow-for-ath11k.patch

I ended up applying both. Running the test now.

MOD: I dont think it fixed anything, I am at 90MB free memory after 1h 32m uptime with 2 clients.

Is it only caused by wifi traffic or any traffic?

How about as temporary measure to generate traffic try running Transmission daemon and connect it to Ubuntu Desktop torrent

Let Transmission download a part file then set download speed limit to zero and leave it to seed the part file

1 Like

I managed to open SSH. How to install it?

143-ath11k-disabling-credit-flow-for-ath11k.patch didn't solve the memory leak, but does look like it solved another "issue" I had the AX3600 that only works as AP. In that unit it always took quite a long while before traffic flowed as expected (i.e., I could often connect to the AP but not other hosts in the LAN, SSHing into the AP and trying to ping those hosts also didn't work), but after the patch everything is up and running without major delays -- I suspect this "issue" was triggered by my two bridges setup that has the IoT radio connected in a different bridge.

It may still be too early to claim success, but so far I'm keeping the 143-ath11k-disabling-credit-flow-for-ath11k.patch for that reason.

5 Likes

Update: I am sorry to report that the issue eventually returned. This time around my wireless connection stopped working much sooner than the usual week (i.e., same issue as always, it's like all of the sudden the switch stops forwarding and I'm stuck in the AP). After rebooting from this connectivity issue I could experience the same delay before traffic started flowing as expected.

Therefore, I am not so sure if the initial success with 143-ath11k-disabling-credit-flow-for-ath11k.patch was actually due to the patch or just luck with that very small testing sample.

I've tested this by unloading the wireless driver with rmmod ath11k-ahb. About ~200MB of RAM was instantly freed up and memory usage remained stable for hours (with light LAN traffic) until I had to reboot to enable wifi again.

1 Like

We are long passed this. The ath11k driver is leaking, that is the issue.

For AX3600 maybe could make use of the ath10k IoT radio connecting in client mode to ath11k radio to produce traffic