Support for RTL838x based managed switches

So, I've been building, fixing, rebasing whilst cleaning lots of stuff. I created a new branch, realtek-wip, where I was doing most of this work, to not interfere too much.

Things I have figured out/fixed:

  • Moved to 5.15. 5.10 is dead to me :smiley:
  • Added nearly all of plappermaul's eth refactoring stuff. I do get a nice ~5 - 10% improvement on iperf. (about 160Mbit with 4 threads, ~164 with a single thread).
  • Kobi's patches are more refined
  • 10/100 mbit mode working
  • mdelay -> msleep to block less
  • new clock and timer patches from plappermaul (turns out, I had the wrong address for 2 of the 5 timers in the dts ...
  • the new mtd-concat stuff which, for vendor uboots, maximizes the storage space :slight_smile:
    DAC < 1m cables (well the microtik one I have) seems to work, 2.5G seems to work, but can't prove this yet as I have nothing that's 2.5G :slight_smile: Should get me a 10G usb dongle for testing ...

What's not working yet, is SMP, I'm thinking this is Kconfig related; but not sure yet what or where. This causes the switch to not boot up due to watchdog timeouts

Speaking of watchdog timeouts, or rather slow behavior during boot, I'm still seeing this occasionally, but once booted, things seem fine (running iperf3 for extended time is fine).

I've pushed the SMP-less stuff to https://gitlab.com/olliver/openwrt/openwrt/-/commits/dev/realtek-dev/ where I hope to get some ttesting feedback, mostly on rtl930x but also on rtl839x and rtl838x. rtl931x is welcome too, but this target is slowly drifting into derelict territory, as it's next to untestable. As I've built so many images and done so many iterations, I have lost track if this works as flawless as I would like. Without the timer stuff, I don't see those weird stalls, so I wonder if those are on rtl83xx as well. Best noticed during boot with single core (due to the watchdog timeout) and during dropbear key generation, as the shell won't respond (well).

What have I tested? Well just iperf3 really. Which isn't a lot. As I wrote above, I still can't get the switch to work as a switch with the initramfs image, probably related to port isolation, @Borromini mentioned this in the past, but I have forgotten, so probably have to scroll up somewhere to see his post :slight_smile:

Since I know to little of dsa and the commands, that's a learning curve for sure.

I'm mostly happy with the current state of the patches, though some birger patches probably still need quite a lot of work. Oh well, such is life :slight_smile: baby steps.

To which brings me to my last point, getting this stuff merged. This relies on testing (of incremental patches? keeping watch at my MR's on github I suppose ...) and actually reviewed and stuff merged.

For this, I cry and plead louder now @svanheule I really need you. Feel free to also look/use cherry-pick and merge stuff from my tree :wink: or, at least on the open MR's. I have almost ~170 patches now, and the more I dick around with it, the more we delay merging, the more patches it'll become. More patches, could also mean that at some point, I'll just dump the branch with 1 major MR, and leave you guys to it :stuck_out_tongue: so we have to put in some miles here.

Sadly, while it's 170 patches, if you compare things to 3 months ago, only very very little changes are visible on the surface :frowning:

Next steps for me, get stuff merged :stuck_out_tongue: fix the smp stuff, checkout the timer delays and start migrating things to regmaps :stuck_out_tongue: which would then allow us to drop most of the duplicated code, and try to write simpler drivers that target all devices.

Also, happy hollidays :slight_smile: :christmas_tree: :bell: :christmas_tree:

4 Likes