Disable offloading on RK3399 network devices (#2079)

* Disable offloading on RK3399 network devices
* Add kernel version checking since we only need this for legacy
* Adjust / fix condition
This commit is contained in:
Igor Pečovnik 2020-07-18 17:41:51 +02:00 committed by GitHub
parent 88a585a3fe
commit a48877aeaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# With offloading enabled, Samba becomes completely useless - transfers to a Windows PC freezes randomly
# Disabling offloading should solve this - all RK3399
IFACE=$1
EVENT=$2
if [[ "$EVENT" != "up" ]]; then
exit 1
fi
if linux-version compare $(uname -r | cut -d '.' -f1,2) gt 4.4; then
exit 1
fi
ETHTOOL=/sbin/ethtool
[ -f $ETHTOOL ] || exit 2
[ -d /sys/devices/platform/fe300000.ethernet/net/$IFACE ] || exit 3
$ETHTOOL -K $IFACE rx off tx off
exit 0