aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2021-04-05 12:54:47 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2021-04-05 13:00:28 -0700
commit4bd8be5f43d07a9e92b73174c7fbef8b989aaa55 (patch)
tree18c957fd0427b3ec4105dfad10f5cb70cd6aa981
parentMerge remote-tracking branch 'github/pr/36' (diff)
downloadnetifrc-4bd8be5f43d07a9e92b73174c7fbef8b989aaa55.tar.gz
netifrc-4bd8be5f43d07a9e92b73174c7fbef8b989aaa55.tar.bz2
netifrc-4bd8be5f43d07a9e92b73174c7fbef8b989aaa55.zip
net/ethtool: support more ethtool config knobs
Additional options now supported: --set-channels --set-dump --set-fec --set-phy-tunable --set-priv-flags --set-rxfh-indir --per-queue --features Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--doc/net.example.Linux.in6
-rw-r--r--net/ethtool.sh15
2 files changed, 16 insertions, 5 deletions
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index b2c0f82..e59ce52 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -1318,10 +1318,10 @@
# 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 eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
+#ethtool_order="flash change-eeprom change priv-flags channels dump pause eee fec coalesce per-queue ring offload features phy-tunable 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 eee coalesce ring offload tunable nfc rxfh-indir ntuple"
+# Hypothetical network card that requires a change-eeprom or priv-flags toggle to enable flashing
+#ethtool_order_eth0="priv-flags change-eeprom flash channels dump pause eee fec coalesce per-queue ring offload features phy-tunable tunable identify nfc rxfh-indir ntuple"
#-----------------------------------------------------------------------------
# Firewalld support
diff --git a/net/ethtool.sh b/net/ethtool.sh
index 0bcceff..ee595a2 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 eee coalesce ring offload tunable identify nfc rxfh-indir ntuple"
+ [ -z "${order}" ] && order="flash change-eeprom change priv-flags channels dump pause eee fec coalesce per-queue ring offload features phy-tunable 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,18 @@ ethtool_pre_start() {
local args_pretty="$(_trim "${p}")"
# Do nothing if empty
[ -z "${args_pretty}" ] && continue
- [ "${opt}" = "eee" -o "${opt}" = "ring" -o "${opt}" = "tunable" ] && opt="set-${opt}"
+ case "$opt" in
+ # Cleaner to patch in future for new options
+ channels) opt="set-${opt}" ;;
+ dump) opt="set-${opt}" ;;
+ eee) opt="set-${opt}" ;;
+ fec) opt="set-${opt}" ;;
+ phy-tunable) opt="set-${opt}" ;;
+ priv-flags) opt="set-${opt}" ;;
+ ring) opt="set-${opt}" ;;
+ rxfh-indir) opt="set-${opt}" ;;
+ tunable) opt="set-${opt}" ;;
+ esac
args_pretty="--${opt} $IFACE ${args_pretty}"
args="--${opt} $IFACE ${args}"
ebegin "ethtool ${args_pretty}"