autocore: maximize ring buffer size for Intel IGC ethernet

Signed-off-by: Nicholas Sun <nicholas-sun@outlook.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 680e4752c5)
This commit is contained in:
Nicholas Sun 2023-09-16 16:50:40 +08:00 committed by Tianling Shen
parent c989b26be4
commit e5a48ffa59
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -22,18 +22,21 @@ start() {
uci set network.@globals[0].packet_steering="1"
uci commit network
for i in $(ip address | awk -F ': ' '/eth[0-9]+/ {print $2}' | xargs)
for i in $(ip address | awk -F ': ' '/eth[0-9]+/ {print $2}' | grep -v '@' | xargs)
do
{
ethtool -K "$i" rx-checksum on
ethtool -K "$i" tx-checksum-ip-generic on || {
ethtool -K "$i" tx-checksum-ipv4 on
ethtool -K "$i" tx-checksum-ipv6 on
}
ethtool -K "$i" tx-scatter-gather on
ethtool -K "$i" gso on
ethtool -K "$i" tso on
ethtool -K "$i" ufo on
ethtool -K "$i" rx-checksum on
ethtool -K "$i" tx-checksum-ip-generic on || {
ethtool -K "$i" tx-checksum-ipv4 on
ethtool -K "$i" tx-checksum-ipv6 on
}
ethtool -K "$i" tx-scatter-gather on
ethtool -K "$i" gso on
ethtool -K "$i" tso on
ethtool -K "$i" ufo on
if ethtool -i "$i" | grep -q "driver: igc"; then
ethtool -G "$i" rx "$(ethtool -g "$i" | awk '/^RX:/ {print $2; exit}')"
ethtool -G "$i" tx "$(ethtool -g "$i" | awk '/^TX:/ {print $2; exit}')"
fi
done
} >"/dev/null" 2>&1