From e5a48ffa592cce24f519219d7b5e67e75605d9a2 Mon Sep 17 00:00:00 2001 From: Nicholas Sun Date: Sat, 16 Sep 2023 16:50:40 +0800 Subject: [PATCH] autocore: maximize ring buffer size for Intel IGC ethernet Signed-off-by: Nicholas Sun Signed-off-by: Tianling Shen (cherry picked from commit 680e4752c52f001a446a14f4f78955c8374fcd09) --- package/emortal/autocore/files/x86/autocore | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/package/emortal/autocore/files/x86/autocore b/package/emortal/autocore/files/x86/autocore index 1fcb9dc755..a54ac01b40 100755 --- a/package/emortal/autocore/files/x86/autocore +++ b/package/emortal/autocore/files/x86/autocore @@ -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