So you got an amazing ARM SBC with the RK3399 CPU (NanoPi M4 / RockPro64 / Rock Pi 4B), so much power into such small form factor. Now you are trying Apache, SCP or other network intensive tasks and your network seems to crash randomly after a while or whenever it is under load? Well it happened to me.
I’ve had a brand new setup of Apache2 running under Debian 9 (armbian 4.4.162-rk3399) and everything was working fine until I tried to download a large file over HTTPS. Small files would download successfully however, larger failed randomly at some point. I wasn’t able to reproduce the issue with plain HTTP, SSH or any other protocol, however…
I eventually found out that this issue was related to the built-in Ethernet and known issues with the RK3399 CPU:
The boards like RK3399 need TCP/UDP offloading disabled to avoid the retransmissions and reset errors. This was already implemented by Ayufan on Rock64 and RockPro64 Rootfs and DietPi needs this too.
A possible workaround for this problem is to add an USB 3 to Ethernet adaptor and use it as your main connection. A much better fix is to disable TCP offloading altogether:
ethtool -K eth0 rx off tx off
You may check offloading status afterwards with
ethtool --show-offload eth0.
Now if you reboot the system your changes will be lost. To survive reboots and network restarts you may create a script at
/etc/network/if-up.d/disable-offload.sh similar to:
#!/bin/bash /sbin/ethtool -K eth0 rx off tx off
Since the offloading should be disables after the network comes up, for this to work properly a
if-up.d script is needed – other solutions you might be thinking of will likely fail (been there, done that).