Adding OpenWrt support for Xiaomi AX3600 (Part 1)

OK, it was missing from the linux-msm so it got me confused but they just marked it not applicable as its
gonna go through a different tree then.

So it's sched to be applied ? Probably thermal-next?

No idea
https://patchwork.kernel.org/project/linux-arm-msm/patch/20210917211403.19640-1-ansuelsmth@gmail.com/

(ot: anyway it's actually incredibile how good the net-next branch works compared to msm... they comment/review/approve patch in max 1-2 days... it's so good to push changes and gets an actual response...)

4 Likes

Yeah, netdev is just a matter of hours for a review.
MSM is couple of weeks to couple of months.

  1. Did a fresh update of AX3600-5.10-restart
  2. added all 'coolsnowwolf' ath11k patches to mac80211
  3. edited ath.mk and /tmp/.config-package.in to make the 512MB option appear and be selected in the wireless kernel packages menu
  4. edited the ax3600.dtsi to import the ipq8074-memory-512m.dtsi and added latter to target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/
    The resulting sysupgrade.bin was used to sysupgrade and produced again a working image on an AX3600. Have no AX6 to test it on.
3 Likes

Really appreciate the help! I didn't edit .config-package.in so the 512MB flag wasn't set at all. The 512MB profile does work on AX6.

How's the stability in AX6 so far? there are still memory leaks?
can you tell which offloading works (tx / rx wired, tx / rx wireless) and which isn't?

IoT radio suddenly broke when I was asleep, dmesg is full of this spam:

[144279.102362] ath10k_pci 0000:01:00.0: failed to send pdev bss chan info request: -108
[144285.102753] ath10k_pci 0000:01:00.0: failed to send pdev bss chan info request: -108
1 Like

Memory leak is still there, but with more available memory to begin with there is now more breathing room. In my case before the 512MB patches OOM consistently occurred within 6 hours after boot (very light load, ~6 stations, AP only). After the patches it hasn't happened yet for 24 hours and counting.

Offloading seem to work in both directions on AX6.

/sys/kernel/debug/qca-nss-drv/stats/ipv4

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< IPV4 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


    ipv4_rx_pkts           = 5029182         common
    ipv4_rx_byts           = 2508842343      common
    ipv4_tx_pkts           = 1469330         common
    ipv4_tx_byts           = 570219523       common
    ipv4_rx_queue[0]_drops = 0               drop
    ipv4_rx_queue[1]_drops = 0               drop
    ipv4_rx_queue[2]_drops = 0               drop
    ipv4_rx_queue[3]_drops = 0               drop

#ipv4 special stats

    ipv4_rx_pkts                               = 2694856         special
    ipv4_rx_bytes                              = 875165647       special
    ipv4_tx_pkts                               = 2694856         special
    ipv4_tx_bytes                              = 895736225       special
    ipv4_create_requests                       = 152885          special
    ipv4_create_collisions                     = 0               special
    ipv4_create_invalid_interface              = 0               special
    ipv4_destroy_requests                      = 43420           special
    ipv4_destroy_misses                        = 0               special
    ipv4_hash_hits                             = 1576732         special
    ipv4_hash_reorders                         = 257             special
    ipv4_flushes                               = 107657          special
    ipv4_evictions                             = 0               special
    ipv4_fragmentations                        = 0               special
    ipv4_by_rule_drops                         = 0               drop
    ipv4_mc_create_requests                    = 0               special
    ipv4_mc_update_requests                    = 0               special
    ipv4_mc_create_invalid_interface           = 0               special
    ipv4_mc_destroy_requests                   = 0               special
    ipv4_mc_destroy_misses                     = 0               special
    ipv4_mc_flushes                            = 0               special
    ipv4_mirror_invalid_ifnum_conn_create_req  = 0               special
    ipv4_mirror_invalid_iftype_conn_create_req = 0               special
    ipv4_mirror_failures                       = 0               special

#ipv4 exception stats

    ipv4_icmp_hdr_incomplete                 = 0               exception
    ipv4_icmp_unhandled_type                 = 65737           exception
    ipv4_icmp_ipv4_hdr_incomplete            = 0               exception
    ipv4_icmp_ipv4_udp_hdr_incomplete        = 0               exception
    ipv4_icmp_ipv4_tcp_header_incomplete     = 1               exception
    ipv4_icmp_sipv4_unknown_protocol         = 2               exception
    ipv4_icmp_no_icme                        = 27              exception
    ipv4_icmp_flush_to_host                  = 0               exception
    ipv4_tcp_header_incomplete               = 0               exception
    ipv4_tcp_no_icme                         = 2105058         exception
    ipv4_tcp_ip_option                       = 0               exception
    ipv4_tcp_ip_fragment                     = 0               exception
    ipv4_tcp_small_ttl                       = 0               exception
    ipv4_tcp_needs_fragmentation             = 0               exception
    ipv4_tcp_flags                           = 107659          exception
    ipv4_tcp_seq_exceeds_right_edge          = 0               exception
    ipv4_tcp_small_data_offs                 = 0               exception
    ipv4_tcp_bad_sack                        = 0               exception
    ipv4_tcp_big_data_offs                   = 0               exception
    ipv4_tcp_seq_before_left_edge            = 0               exception
    ipv4_tcp_ack_exceeds_right_edge          = 0               exception
    ipv4_tcp_ack_before_left_edge            = 0               exception
    ipv4_udp_header_incomplete               = 0               exception
    ipv4_udp_no_icme                         = 1280118         exception
    ipv4_udp_ip_option                       = 0               exception
    ipv4_udp_ip_fragment                     = 0               exception
    ipv4_udp_small_ttl                       = 0               exception
    ipv4_udp_needs_fragmentation             = 0               exception
    ipv4_wrong_target_mac                    = 0               exception
    ipv4_header_incomplete                   = 0               exception
    ipv4_bad_total_length                    = 0               exception
    ipv4_bad_checksum                        = 0               exception
    ipv4_non_initial_fragment                = 0               exception
    ipv4_datagram_incomplete                 = 0               exception
    ipv4_options_incomplete                  = 0               exception
    ipv4_unknown_protocol                    = 1250            exception
    ipv4_esp_header_incomplete               = 0               exception
    ipv4_esp_no_icme                         = 0               exception
    ipv4_esp_ip_option                       = 0               exception
    ipv4_esp_ip_fragment                     = 0               exception
    ipv4_esp_small_ttl                       = 0               exception
    ipv4_esp_needs_fragmentation             = 0               exception
    ipv4_ingress_vid_mismatch                = 0               exception
    ipv4_ingress_vid_missing                 = 0               exception
    ipv4_6rd_no_icme                         = 0               exception
    ipv4_6rd_ip_option                       = 0               exception
    ipv4_6rd_ip_fragment                     = 0               exception
    ipv4_6rd_needs_fragmentation             = 0               exception
    ipv4_dscp_marking_mismatch               = 0               exception
    ipv4_vlan_marking_mismatch               = 0               exception
    ipv4_interface_mismatch                  = 0               exception
    ipv4_gre_header_incomplete               = 0               exception
    ipv4_gre_no_icme                         = 0               exception
    ipv4_gre_ip_option                       = 0               exception
    ipv4_gre_ip_fragment                     = 0               exception
    ipv4_gre_small_ttl                       = 0               exception
    ipv4_gre_needs_fragmentation             = 0               exception
    ipv4_pptp_gre_session_match_fail         = 0               exception
    ipv4_pptp_gre_invalid_proto              = 0               exception
    ipv4_pptp_gre_no_cme                     = 0               exception
    ipv4_pptp_gre_ip_option                  = 0               exception
    ipv4_pptp_gre_ip_fragment                = 0               exception
    ipv4_pptp_gre_small_ttl                  = 0               exception
    ipv4_pptp_gre_needs_fragmentation        = 0               exception
    ipv4_destroy                             = 0               exception
    ipv4_frag_df_set                         = 0               exception
    ipv4_frag_fail                           = 0               exception
    ipv4_icmp_ipv4_udplite_header_incomplete = 0               exception
    ipv4_udplite_header_incomplete           = 0               exception
    ipv4_udplite_no_icme                     = 0               exception
    ipv4_udplite_ip_option                   = 0               exception
    ipv4_udplite_ip_fragment                 = 0               exception
    ipv4_udplite_small_ttl                   = 0               exception
    ipv4_udplite_needs_fragmentation         = 0               exception
    ipv4_mc_udp_no_icme                      = 0               exception
    ipv4_mc_mem_alloc_failure                = 0               exception
    ipv4_mc_update_failure                   = 0               exception
    ipv4_mc_pbuf_alloc_failure               = 0               exception
    ipv4_pppoe_bridge_no_icme                = 0               exception
    ipv4_pppoe_no_session                    = 0               drop
    ipv4_icmp_ipv4_gre_hdr_incomplete        = 0               exception
    ipv4_icmp_ipv4_esp_hdr_incomplete        = 0               exception
    ipv4_emesh_prio_mismatch                 = 0               exception
2 Likes

I'm using robimarko's fork but I can't get fast transition working :

My ax3600 is used as dumb ap and is connected to other router also using openwrt.

my phone do transition from ax to other ap seemlessly, but when it try to go from the other ap to ax, the device get connected to wifi but then disconnect after 3 secs.
After that, if I try to reconnect to wifi, the phone hang in dhcp and don't get connected.

@avalentin did you do something special to get fast transition working ?

my phone do transition from ax to other ap seemlessly, but when it try to go from the other ap to ax, the device get connected to wifi but then disconnect after 3 secs.
After that, if I try to reconnect to wifi, the phone hang in dhcp and don't get connected.

I experienced exactly the same with transition between coolsnowwolf build on two AX3600 in dumb AP mode, and even with 802.11r disabled. So probably it's not specific to robimarko's fork.

No, it's standard. Perhaps you miss this bit?

1 Like

@robimarko
Please update your fork, we facing many packages error, example:

ERROR: please fix feeds/packages/utils/zstd/Makefile - see logs/feeds/packages/utils/zstd/dump.txt for details

What forks is everyone using atm? (maybe add this info to the wiki page?)

I just bought 2 of this because it looks it might be official supported in the near future :slight_smile:

Thanks! This script fixes roaming issue on coolsnowwolf build too. After running the latter for about 24h, I can say that the leak is there as well (512M profile patch is applied in these builds):

  1. The free memory looks solid with zero wireless clients
  2. Slowly leaks with 1-2 clients

Sadly, looks like no coolsnowwolf patches fix the leak :cry:

I'm using a slightly older version of robimarkos tree with the 512MB patch and currently it looks like this:

root@OpenWrt:~# uptime
 17:30:16 up 29 days, 23:02,  load average: 0.00, 0.00, 0.00

So I guess it's rock solid.

It looks the coolsnow patches and the 512M patch make a clear difference:

 19:55:15 up 2 days,  8:06,  load average: 0.00, 0.00, 0.00
              total        used        free      shared  buff/cache   available
Mem:         417496      287380       52492          92       77624       67096

It seems to stabilise at around 77M.

Without, it workes less than 1 day.

1 Like

Hm, maybe, I wasn't patient enough. I gave up after ~23h, seeing free mem gradually decreases, but it was far from 77M, more like 150M and dropping. OK, thanks for sharing: I'll give it a go again, this time till it OOM's or stabilizes

I noticed one strange thing. I have 2 AX3600: an originally global one, and a Chinese one. Both have bdata patched, and both flashed with identical coolsnowwolf OpenWrt builds. For some reason the global router has 92.8M of /overlay, while the CN one -- only 10.3M:



BusyBox v1.33.1 (2021-09-17 04:57:46 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r3703-a3f095db4
 -----------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                12.0M     12.0M         0 100% /rom
tmpfs                   203.7M      2.3M    201.4M   1% /tmp
/dev/ubi0_2              92.8M      7.1M     81.0M   8% /overlay
overlayfs:/overlay       92.8M      7.1M     81.0M   8% /
tmpfs                   512.0K         0    512.0K   0% /dev

vs



BusyBox v1.33.1 (2021-09-17 04:57:46 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r3703-a3f095db4
 -----------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                12.0M     12.0M         0 100% /rom
tmpfs                   203.7M      2.3M    201.4M   1% /tmp
/dev/ubi0_2              10.3M      6.2M      3.5M  64% /overlay
overlayfs:/overlay       10.3M      6.2M      3.5M  64% /
tmpfs                   512.0K         0    512.0K   0% /dev

What could have caused this, and is there a way to get large /overlay on the second router too?
Thanks!