Perhaps somewhat naievly I've built qca_nss_bridge_mgr as well as qca_nss_vlan which it seems to depend on.
I actually spent more time preparing the Makefile to get it to attempt to build the modules than fixing the one issue the modules had. Good learning experience
It sort of works... in terms of 1 step forward 2 steps back.
The Pi and Macbook can roam freely between the Asus & 703n.
That's where the good news ends.
4 or 5 times in a row it panicked at pretty much the same uptime +- 5s. As I'm writing this it's somehow survived longer and panicked at 848s. Always at br_fdb_bridge_dev_get_and_hold, which I'll get to later.
[ 496.607273] Mem abort info:
[ 496.614055] ESR = 0x96000004
[ 496.616742] EC = 0x25: DABT (current EL), IL = 32 bits
[ 496.619904] SET = 0, FnV = 0
[ 496.625330] EA = 0, S1PTW = 0
[ 496.628229] Data abort info:
[ 496.631231] ISV = 0, ISS = 0x00000004
[ 496.634349] CM = 0, WnR = 0
[ 496.637955] [0000ffffffc0101c] address between user and kernel address ranges
[ 496.641053] Internal error: Oops: 96000004 [#1] SMP
[ 496.648155] Modules linked in: iptable_nat ath11k_ahb ath11k ath10k_pci ath10k_core ath xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD nf_nat nf_flow_table nf_conntrack mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG ppp_async nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables hwmon crc_ccitt compat qca_nss_pppoe pppoe pppox ppp_generic slhc qca_nss_bridge_mgr qca_nss_vlan nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 qca_nss_drv qca_nss_dp qca_ssdk seqiv jitterentropy_rng drbg michael_mic hmac cmac leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug
[ 496.698321] CPU: 0 PID: 280 Comm: kworker/0:2 Tainted: G W 5.10.54 #0
[ 496.720557] Hardware name: Xiaomi AX3600 (DT)
[ 496.728374] Workqueue: events_long br_fdb_cleanup
[ 496.732619] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO BTYPE=--)
[ 496.737311] pc : br_fdb_bridge_dev_get_and_hold+0x4/0x38
[ 496.743395] lr : nss_bridge_mgr_find_instance+0x100/0x1f0 [qca_nss_bridge_mgr]
[ 496.748680] sp : ffffffc013063c70
[ 496.755703] x29: ffffffc013063c70 x28: 0000000000000000
[ 496.759093] x27: ffffff8003424d50 x26: ffffffc01004c930
[ 496.764475] x25: ffffffc01238b9b0 x24: ffffff80034248c0
[ 496.769771] x23: ffffffc013063d8a x22: 0000000000000000
[ 496.775066] x21: 00000000000124f8 x20: 00000000fffffffe
[ 496.780361] x19: ffffffc013063d8a x18: 0000000000000000
[ 496.785655] x17: 0000000000000000 x16: 0000000000000000
[ 496.790951] x15: 0000000000000000 x14: 0000000000000040
[ 496.796247] x13: 0000000000000228 x12: 0000000000000000
[ 496.801541] x11: 0000000000000000 x10: 0000000000000000
[ 496.806837] x9 : 0000000000000000 x8 : ffffff801f6cde00
[ 496.812132] x7 : ffffffc01232ecd8 x6 : 0000000000000000
[ 496.817427] x5 : ffffffc013063b48 x4 : ffffffc0089fd8c8
[ 496.822722] x3 : 0000000000000000 x2 : ffffffc013063d8a
[ 496.828017] x1 : 0000000000000000 x0 : 4300ffffffc01004
[ 496.833313] Call trace:
[ 496.838604] br_fdb_bridge_dev_get_and_hold+0x4/0x38
[ 496.840784] atomic_notifier_call_chain+0x58/0x88
[ 496.845986] br_fdb_cleanup+0x1a4/0x1e8
[ 496.850587] process_one_work+0x200/0x3b0
[ 496.854231] worker_thread+0x54/0x4e8
[ 496.858396] kthread+0x124/0x128
[ 496.862043] ret_from_fork+0x10/0x30
[ 496.865345] Code: 9400bab0 d4210000 17ffffd2 d503233f (f9400c01)
[ 496.868905] ---[ end trace 04421dadb8445493 ]---
[ 496.874893] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[ 496.879587] SMP: stopping secondary CPUs
[ 496.886265] Kernel Offset: disabled
[ 496.890341] CPU features: 0x0040002,20002000
[ 496.893553] Memory Limit: none
[ 497.098090] Rebooting in 3 seconds..
Similarly connecting to the Ath11 network causes an instant panic at the same place.
Now to the build... All that's missing is the function br_fdb_bridge_dev_get_and_hold() which as noted above just happens to cause the panic. Curiously this function is nothing more than a wrapper
struct net_device *br_fdb_bridge_dev_get_and_hold(struct net_bridge *br)
{
dev_hold(br->dev);
return br->dev;
}
EXPORT_SYMBOL_GPL(br_fdb_bridge_dev_get_and_hold);
And is called just once. It might make more sense if there was an accompanying br_fdb_bridge_dev_put() which was a wrapper for dev_put() but alas, inside nss_bridge_mgr_fdb_update_callback() they call dev_put() directly. I'm sure QC must have big plans for br_fdb_bridge_dev_put() in the future!
That snippet lives in net/bridge/br_fdb.c
The the following definition goes in include/linux/if_bridge.h
extern struct net_device *br_fdb_bridge_dev_get_and_hold(struct net_bridge *br);
The qca-nss-clients Makefile:
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-clients
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/nss-clients
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-04-29
PKG_SOURCE_VERSION:=b93c72c1b72c591c2ddc2f0b24f0e2b457720118
PKG_MIRROR_HASH:=9fab23da994bfbac9a3cef32cdfec31a87a03ed415f36bc926da32b7b0934259
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/qca-nss-drv-pppoe
SECTION:=kernel
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
FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
endef
define KernelPackage/qca-nss-drv-pppoe/Description
Kernel modules for NSS connection manager - Support for PPPoE
endef
define KernelPackage/qca-nss-drv-bridge-mgr
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=Kernel driver for NSS bridge manager
DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv +kmod-qca-nss-drv-vlan-mgr
FILES:=$(PKG_BUILD_DIR)/bridge/qca-nss-bridge-mgr.ko
AUTOLOAD:=$(call AutoLoad,51,qca-nss-bridge-mgr)
endef
define KernelPackage/qca-nss-drv-bridge-mgr/Description
Kernel modules for NSS bridge manager
endef
define KernelPackage/qca-nss-drv-vlan-mgr
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=Kernel driver for NSS vlan manager
DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv
FILES:=$(PKG_BUILD_DIR)/vlan/qca-nss-vlan.ko
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vlan)
endef
define KernelPackage/qca-nss-drv-vlan-mgr/Description
Kernel modules for NSS vlan manager
endef
EXTRA_CFLAGS+= \
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
-I$(STAGING_DIR)/usr/include/qca-nss-crypto \
-I$(STAGING_DIR)/usr/include/qca-nss-cfi \
-I$(STAGING_DIR)/usr/include/qca-nss-gmac \
-I$(STAGING_DIR)/usr/include/qca-ssdk \
-I$(STAGING_DIR)/usr/include/qca-ssdk/fal \
-I$(STAGING_DIR)/usr/include/nat46
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe),)
NSS_CLIENTS_MAKE_OPTS+=pppoe=y
endif
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr),)
NSS_CLIENTS_MAKE_OPTS+=bridge-mgr=y
#enable OVS bridge if ovsmgr is enabled
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
NSS_CLIENTS_MAKE_OPTS+= NSS_BRIDGE_MGR_OVS_ENABLE=y
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr
endif
endif
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr),)
NSS_CLIENTS_MAKE_OPTS+=vlan-mgr=y
endif
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
SOC="ipq807x_64"
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64"
endif
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" $(strip $(NSS_CLIENTS_MAKE_OPTS)) \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
SoC=$(SOC) \
$(KERNEL_MAKE_FLAGS) \
modules
endef
$(eval $(call KernelPackage,qca-nss-drv-pppoe))
$(eval $(call KernelPackage,qca-nss-drv-bridge-mgr))
$(eval $(call KernelPackage,qca-nss-drv-vlan-mgr))