commit: b8373edc844297fb54333ffab69d0cd0a7b5e0b8 Author: Maciej S. Szmigiero <mail <AT> maciej <DOT> szmigiero <DOT> name> AuthorDate: Sat Mar 27 22:32:35 2021 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Sat Mar 27 22:34:02 2021 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b8373edc
net/ethtool.sh: add "eee" and "tunable" setting operations This adds an ability to set "eee" and "tunable" ethtool parameters of a network interface. Signed-off-by: Maciej S. Szmigiero <mail <AT> maciej.szmigiero.name> doc/net.example.Linux.in | 12 +++++++++--- net/ethtool.sh | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in index 3bd2ee1..b2c0f82 100644 --- a/doc/net.example.Linux.in +++ b/doc/net.example.Linux.in @@ -1275,12 +1275,18 @@ #ethtool_pause_eth0="autoneg off #rx on tx on" +# Enable Energy-Efficient Ethernet +#ethtool_eee_eth0="eee on" + # Enable adaptive RX and TX coalescing #ethtool_coalesce_eth0="adaptive-rx on adaptive-tx on" # Change ring buffer settings #ethtool_ring_eth0="" +# Set RX copy-break at 1500 bytes +#ethtool_tunable_eth0="rx-copybreak 1500" + # Enable all offload settings #ethtool_offload_eth0="rx on tx on sg on tso on ufo on gso on gro on lro on" @@ -1309,13 +1315,13 @@ # Additionally, there is a special control variable, if you need to change the # order of option processing. The default order is: -# flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple +# flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple # Set global order to default -#ethtool_order="flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple" +#ethtool_order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple" # Hypothetical network card that requires a change-eeprom toggle to enable flashing -#ethtool_order_eth0="change-eeprom flash change pause coalesce ring offload nfc rxfh-indir ntuple" +#ethtool_order_eth0="change-eeprom flash change pause eee coalesce ring offload tunable nfc rxfh-indir ntuple" #----------------------------------------------------------------------------- # Firewalld support diff --git a/net/ethtool.sh b/net/ethtool.sh index 57c98f7..0bcceff 100644 --- a/net/ethtool.sh +++ b/net/ethtool.sh @@ -17,7 +17,7 @@ ethtool_pre_start() { local order opt OFS="${OIFS}" eval order=\$ethtool_order_${IFVAR} [ -z "${order}" ] && eval order=\$ethtool_order - [ -z "${order}" ] && order="flash change-eeprom change pause coalesce ring offload identify nfc rxfh-indir ntuple" + [ -z "${order}" ] && order="flash change-eeprom change pause eee coalesce ring offload tunable identify nfc rxfh-indir ntuple" # ethtool options not used: --driver, --register-dump, --eeprom-dump, --negotiate, --test, --statistics eindent for opt in ${order} ; do @@ -36,7 +36,7 @@ ethtool_pre_start() { local args_pretty="$(_trim "${p}")" # Do nothing if empty [ -z "${args_pretty}" ] && continue - [ "${opt}" = "ring" ] && opt="set-ring" + [ "${opt}" = "eee" -o "${opt}" = "ring" -o "${opt}" = "tunable" ] && opt="set-${opt}" args_pretty="--${opt} $IFACE ${args_pretty}" args="--${opt} $IFACE ${args}" ebegin "ethtool ${args_pretty}"