Adding OpenWrt support for Xiaomi AX3600

i tried this yed. My device is getting an ip adress form the TFTP Server but then die netwirk connection goes down - i do not know why.
And so long i did not manage to interrupt the boot process so that i can connect via intrams. I can enter the failsafe mode, but this is no use when you have problems with the bootloader

Did some extra digging and it seems that issue with WoL is actually connected to the fact, that ethernet connection is only working in 1000Mbps mode. Tried two devices and on both of them changing speed & duplex to either 100 or 10 Mbps mode resulted in broken internet connectivity. Both PC & router still reports that link is up but there is no internet connection at all and I was wondering if it could be something similar to this issue. Could someone else confirm that issue perhaps? I

Beside that issue, it backport branch seems to be quite stable - I'm using IoT antenna for IoT devices (7 of them) & on main network there are period of time when no devices are connected at all. At some point, router had only 44MB of free memory but I wasn't able to reach OOM state after 7 days of usage

Pushed some more FW stats and regulatory backports

6 Likes

@robimarko could you please add kmod-wireguard to your release (or better full support for wireguard server)? Thanks for your work.

Did any of the backports solve your Poco F2 disconnect/reconnect problem?

It wasn't even the backports fault, it's the stupid QCA switch driver using hardcoded DTS values for how to set up forwarding.
I was using one of the LAN ports in DHCP client mode for uplink but since its isolated with the LAN bitmap the WLAN interface didn't have an uplink and then Poco F2 would reconnect due to "No networking" every couple of seconds, now it works fine when using the dedicated WAN port

1 Like

I had it setup just as a dumb AP connected to my main gateway through one of the LAN ports and got the disconnect bug when connecting to the 5GHz AX radio, the 2.4GHz AX radio seems to work more or less fine.

Yeah, I had the same setup and both 2 and 5GHz radios did the same thing, its due to f*cking QCA switch drivers not using DSA but that hardcoded hackery and then it doesn't forward properly as only the WAN port is allowed to forward directly to the CPU

Sorry but what was your solution?

Connect the uplink to the WAN port instead of the LAN port?

Yeah, just use the WAN port(I know its a stupid limitation)

1 Like

Do you need to change any firewall settings or anything else?

I usually have the firewall disabled on a dumb AP.

You can disable the firewall completely or allow everything under the WAN zone.
I also usually just utilize the br-lan interface with DHCP client enable to run my AP-s as that gets rid of FW completely.

2 Likes

To answer you, I won't add anything that is not necessary, I am not aiming for one build fits all.
It's just to make life easier for people and provide some prebuilts.
Otherwise everybody will want something and we will end up with a mess.

I looked into providing prebuilt kmods in a feed, but that's a whole new level of pain for the QCA drivers as those check for kernel options and for example the bonding support will be built as a kmod and then NSS clients will fail as they want to compile more code etc.

5 Likes

After changing my config as to how you described, moved WAN port to br-lan and connected my AX3600 as a bumb AP to my gateway through the WAN port, I still get the disconnects every few seconds on my Poco F3.

I didnt move to it br-lan, that what I usually do but I dont think it will work here.
Just try using the default config, plug into WAN and start an AP as see if it still reconnects

Hello all,

Has been a while I didn't follow what was up here, las time I tried a build the main problem blocking me to use the build as a production build was the mem leak. Has this been solved? If so I will take some time to start trying again a new build :slight_smile:

Anyways huge thanks to all the devs and especially robimarko for the intense work on this platform!

Cheers!

There's a simple patch to build nss-clients without disabling bonding kmod:

diff --git a/pppoe/Makefile b/pppoe/Makefile
index 3ee05b7..f3fa818 100644
--- a/pppoe/Makefile
+++ b/pppoe/Makefile
@@ -6,5 +6,5 @@ obj-m += qca-nss-pppoe.o
 qca-nss-pppoe-objs := nss_connmgr_pppoe.o
 
 ifneq (,$(filter $(CONFIG_BONDING),y m))
-ccflags-y += -DBONDING_SUPPORT
+#ccflags-y += -DBONDING_SUPPORT
 endif

Basically a hack to skip the problematic bonding code in pppoe.

Yeah, but that's fixes just bonding, I really am not in the mood to go through each config check to see whats gonna get compiled in and probably break everything.

Hi,

This is the actual fix for bonding (I ported it from an older QSDK with kernel 4.x), I tested it with a 5.10 LEDE/Chinese build a few weeks ago, it worked fine. This is yet another proof that Qualcomm barely test anything..

Just save it in patches-5.10 as 605-net-bonding-add-bond-get-id.patch:

--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -247,6 +247,7 @@ static const struct flow_dissector_key f
 };

 static struct flow_dissector flow_keys_bonding __read_mostly;
+static unsigned long bond_id_mask = 0xFFFFFFF0;

 /*-------------------------- Forward declarations ---------------------------*/

@@ -301,6 +302,20 @@ netdev_tx_t bond_dev_queue_xmit(struct b
 	return dev_queue_xmit(skb);
 }

+int bond_get_id(struct net_device *bond_dev)
+{
+    struct bonding *bond;
+
+    if (!((bond_dev->priv_flags & IFF_BONDING) &&
+          (bond_dev->flags & IFF_MASTER)))
+        return -EINVAL;
+
+    bond = netdev_priv(bond_dev);
+
+    return bond->id;
+}
+EXPORT_SYMBOL(bond_get_id);
+
 /*---------------------------------- VLAN -----------------------------------*/

 /* In the following 2 functions, bond_vlan_rx_add_vid and bond_vlan_rx_kill_vid,
@@ -4822,6 +4837,9 @@ static void bond_destructor(struct net_d
 	struct bonding *bond = netdev_priv(bond_dev);
 	if (bond->wq)
 		destroy_workqueue(bond->wq);
+
+    if (bond->id != (~0U))
+        clear_bit(bond->id, &bond_id_mask);
 }

 void bond_setup(struct net_device *bond_dev)
@@ -4936,7 +4954,7 @@ static int bond_check_params(struct bond
 	int bond_mode	= BOND_MODE_ROUNDROBIN;
 	int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
 	int lacp_fast = 0;
-	int tlb_dynamic_lb;
+    int tlb_dynamic_lb;

 	/* Convert string parameters. */
 	if (mode) {
@@ -5275,7 +5293,7 @@ static int bond_check_params(struct bond
 	params->peer_notif_delay = 0;
 	params->use_carrier = use_carrier;
 	params->lacp_fast = lacp_fast;
-	params->primary[0] = 0;
+    params->primary[0] = 0;
 	params->primary_reselect = primary_reselect_value;
 	params->fail_over_mac = fail_over_mac_value;
 	params->tx_queues = tx_queues;
@@ -5390,7 +5408,15 @@ int bond_create(struct net *net, const c
 	bond_work_init_all(bond);

 	rtnl_unlock();
-	return 0;
+
+    bond = netdev_priv(bond_dev);
+    bond->id = ~0U;
+    if (bond_id_mask != (~0UL)) {
+        bond->id = (u32)ffz(bond_id_mask);
+        set_bit(bond->id, &bond_id_mask);
+    }
+
+    return 0;
 }

 static int __net_init bond_net_init(struct net *net)
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -256,6 +256,7 @@ struct bonding {
 	/* protecting ipsec_list */
 	spinlock_t ipsec_lock;
 #endif /* CONFIG_XFRM_OFFLOAD */
+    u32      id;
 };

 #define bond_slave_get_rcu(dev) \
@@ -629,6 +629,7 @@ struct bond_net {
 
 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
 netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
+int bond_get_id(struct net_device *bond_dev);
 int bond_create(struct net *net, const char *name);
 int bond_create_sysfs(struct bond_net *net);
 void bond_destroy_sysfs(struct bond_net *net);
1 Like

I also needed to add the bonding kmod to the qca-nss-clients Makefile:

diff --git a/package/qca/nss/qca-nss-clients/Makefile b/package/qca/nss/qca-nss-clients/Makefile
index 11abb99a7..9c5168fb3 100644
--- a/package/qca/nss/qca-nss-clients/Makefile
+++ b/package/qca/nss/qca-nss-clients/Makefile
@@ -17,7 +17,7 @@ define KernelPackage/qca-nss-drv-pppoe
   CATEGORY:=Kernel modules
   SUBMENU:=Network Devices
   TITLE:=Kernel driver for NSS (connection manager) - PPPoE
-  DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv +kmod-ppp +kmod-pppoe
+  DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv +kmod-ppp +kmod-pppoe +kmod-bonding
   FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
   AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
 endef
1 Like