What exactly is required to update a device using a swconfig-based switch driver to a DSA-based switch driver?

In particular, I have a Netgear R9000 running (unofficial) openWRT firmware. This router has dual QCA8337N switches in a master-slave setup and (currently) uses a swconfig switch driver.

The QCA switch already has a DSA driver. Furthermore, that DSA driver supports hardware flow offloading (which is the main reason I'm looking into switching to DSA).

What exactly needs to happen to successfully switch over to DSA and to utalize hardware flow offloading?

  • I know Ill need to modify the switch config in /etc/config/network, but this doesnt seem too hard. It would be nice if this was all that I needed to change, but I suspect not...

  • I suspect Ill need to manually compile in DSA support (using the make kernel_menuconfig menu when compiling), but I also know how to do this

  • I suspect Ill need to manually compile in some support for hardware flow offloading. The device uses nf_tables wherever possible (including using fw4), and Ive compiled in some nf_tables HW NAT support, but idk if I need other stuff as well.

  • I dont know if any other on-device files (e.g., /etc/board.json or /etc/board.d/02-network) need to be modified

  • I dont know if any of the configuration files / source code used during compilation need to be changed (e.g., the alpine-netgear.dtsi file at target/linux/alpine/files/arch/arm/boot/dts/ in the openWRT build tree)

  • perhaps other stuff???

Thanks in advance

You also need to disable the swconfig kernel modules and enable qca8k, as well as making the DTS changes.

h/w offloading is not merged into qca8k yet, but blogic has worked on that in the past (so proof of concept code exists) and Ansuel has also looked into this topic late last year. Don't expect that to be easy, especially the later aspect of getting h/w offloading working, but it would be a reasonable task - and at least the switch to DSA should be done either way.

That said, while FCC images are very blurry, I read QCA8337-AL3C there - which would imply that there is no h/w NAT available (this would require QCA8337N).

1 Like

You'll likely need to at least:

  • Modify the DTS to change the devices from direct to DSA drivers.
  • Change the setup scripts (preinit and those that generate board.json) to provide connectivity and be self-consistent (the initial /etc/config/network is autogenerated
  • Ensure that each port has a unique MAC address for those that don't use the typical WAN/LAN-bridge configuration (this generally will need you to auto-generate locally administered MAC addresses)
  • Ensure that the generation of WiFi MACs doesn't overlay with those assigned to the switch
  • Confirm that everything is working (failsafe, general mode, VLAN trunking and filtering, including non-WAN/LAN configurations)

AFAIK, going to DSA also means going to a single Ethernet channel between the "CPU" and the switch. This is a Linux limitation at this time. This may or may not be an issue for your device, depending on the hardware.

2 Likes

Correct, but patches to rectify this exist (getting this mainlined or into OpenWrt is another topic though, but it works and helps).

Well...thats tooo bad. I had been going off of the WikiDev R9000 page, which lists a QCA8337N switch, but the FCC report pictures (in particular on the page labeled "page 12", which is the 6th page in the pdf) do indeed seem to say QCA8337-AL3C.

Oh well. In that case, my interest in converting to a DSA switch driver is significantly reduced. It seemed like a worthwhile project if it unlocked HW NAT, but without that is seems like a lot of work for basically no gain.

It gets you closer to get r9000/ alpine support into a state suitable to merge into OpenWrt.