Closed Paraphraser closed 1 year ago
I've run into this same issue - it would be nice to get the script updated for the newer kernel.
I don't think this is a problem any more:
./scripts/cm4_lan7800.sh
. Way back when I first purchased the mini router, I didn't do more than skim-read the docs (yes, my bad) so I didn't notice the instructions about cloning this repo and building the driver etc.
I set up a test network and started running iperf
tests. I observed:
eth0
(the CM4 interface) had perfectly adequate forwarding performance;eth1
(the mini router USB-special) had woeful asymmetric forwarding performance, substantially worse than eth0
.After some mucking about:
cm4_lan7800.sh
scriptI saw reasonable, symmetric, forwarding performance, on par with eth0
. I pronounced everything good and moved on.
It was slightly annoying to have to rebuild the driver each time the kernel updated but not really a big deal.
Until this issue came along.
Another kernel update came my way in the last few days. The inability to compile the driver was still present so I decided to drill further.
The Seeed doco says:
but that seemed to be at odds with what I was seeing on torvalds/linux/tree/master/drivers/net/usb which had five changes in 2022 and two so far this year.
On a hunch, I replaced lan78xx.h
and lan78xx.c
from this repo with the files of the same name from the torvalds/linux repo. The driver compiled first time and installed but dmesg | grep lan
complained that the sanctity of the kernel was under threat (my words - I didn't make a note of the actual message). I uninstalled the driver I had just compiled.
I was considering doing a compare/contrast of the Seeed and torvalds/linux versions with a view to trying to figure out the origin of the claim that "the left-side port will provide … a much reduced speed" but it occurred to me to first verify that statement by re-running my iperf
tests:
eth0
built-in CM4 interface trunks a VLAN to a managed switch (ultimately 192.168.134.0/25 will be the house network, 192.168.134.128/25 a DMZ network)The RTR eth1
is the mini router USB-special. The driver here is "just as it comes" with Linux:
$ lsusb | grep LAN
Bus 002 Device 002: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC) LAN7800
$ dmesg | grep lan
[ 1.497051] usbcore: registered new interface driver lan78xx
[ 2.354091] lan78xx 2-3:1.0 (unnamed net_device) (uninitialized): int urb period 64
[ 9.643980] lan78xx 2-3:1.0 eth1: Link is Up - 1Gbps/Full - flow control rx/tx
Forwarding performance was measured with iperf3
. The blue and green flows indicate the transfer speeds I observed. I see nothing to complain about.
My guess is the earlier problem was fixed by:
That change is dated March 3, 2023.
It would be really useful if someone else could run their own tests and validate my findings. If it turns out that the kernel-supplied driver works, generally, then we can probably set about updating the Seeed doco.
Describe the bug
I have just done a routine:
and the result is a broken reRouter CM4 1432.
Kernel change
uname -a
output:Linux sys-rtr 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux
Linux sys-rtr 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux
lan7800 driver fails after kernel upgrade
This has happened several times since I acquired the reRouter CM4 1432 so I just follow the instructions at Ethernet Ports Configuration/
rebuilding lan7800 fails after kernel upgrade
I went through this loop of finding and fixing a bug in
cm4_lan7800.sh
once before - #52 - but this one is beyond me. The result is I no longer have a working driver for the lan7800.install_rpi
failsI also tried the instructions at Step 2: Install *.dtbo to see if they fared any better:
If anything, I'd call that worse.
Discussion
The "obvious" solution is to downgrade Raspberry Pi OS to the previous kernel where I know lan7800 will still compile. Googling that topic arrives at the (unfortunate) answer that it isn't supported and a re-installation is in your future.
My original intention in purchasing the Seeed reRouter CM4 1432 was to go through the process of building my own router on top of Raspberry Pi OS. The notion of two Ethernet ports seemed like a good idea at the time and I got a fair way down the track, just short of putting it into production.
It is problems of this kind (what should be routine OS maintenance tasks causing breakages) that have given me pause.
If I only ever needed to recompile the driver, I could handle that. After all, the second Ethernet port still "works" without the driver, it just has asymmetric forwarding performance.
But rebuilding? It may just be me but any sentence including the word "rebuild" is never going to be high on my list of desirable features for a home router, particularly when a rebuild needs to begin with taking the router offline and opening the case.
I'm rapidly reaching the conclusion that the Seeed reRouter CM4 1432 was a nice idea in theory, shame about the practice.
Yes, I could switch to OpenWRT but that defeats my original purpose. The product claimed to run Raspberry Pi OS. It does, but only up to a point. The support for the additional features like the second Ethernet port seems to be a bit … lacking.
And, yes, I could just ignore the second Ethernet port and do everything with VLANs but then I'd be asking myself why I didn't just go with a standard Pi4 in the first place?
I realise that the last few paragraphs are editorialising and don't help solve the problem at hand. I've included them for two reasons:
To Reproduce
Included above in commands.
Expected behavior
I expected
sudo ./scripts/cm4_lan7800.sh
to compile and install the driver, not chuck up errors.Screenshots
Terminal output copy/paste in the above.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Included above (eg
sudo make install_rpi
)