From 69573d675092b7e523f1d5dab6fec3bb5012b25e Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 21 Jul 2017 11:28:32 +0100 Subject: [PATCH] Intel 82574L NIC powersaving fix for tiamat hosts --- .../devices/files/default/fixeep-82574_83.sh | 45 +++++++++++++++++++ cookbooks/devices/recipes/default.rb | 6 +++ .../devices/templates/default/udev.rules.erb | 3 ++ 3 files changed, 54 insertions(+) create mode 100755 cookbooks/devices/files/default/fixeep-82574_83.sh diff --git a/cookbooks/devices/files/default/fixeep-82574_83.sh b/cookbooks/devices/files/default/fixeep-82574_83.sh new file mode 100755 index 000000000..ca1ee4453 --- /dev/null +++ b/cookbooks/devices/files/default/fixeep-82574_83.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 \" + echo " i.e. $0 eth0" + exit 1 +fi + +if ! ifconfig $1 > /dev/null; then + exit 1 +fi + +bdf=$(ethtool -i $1 | grep "bus-info:" | awk '{print $2}') +dev=$(lspci -s $bdf -x | grep "00: 86 80" | awk '{print "0x"$5$4$3$2}') + +case $dev in + 0x10d38086) + echo "$1: is a \"82574L Gigabit Network Connection\"" + ;; + 0x10f68086) + echo "$1: is a \"82574L Gigabit Network Connection\"" + ;; + 0x150c8086) + echo "$1: is a \"82583V Gigabit Network Connection\"" + ;; + *) + echo "No appropriate hardware found for this fixup" + exit 1 + ;; +esac + +echo "This fixup is applicable to your hardware" + +var=$(ethtool -e $1 | grep 0x0010 | awk '{print $16}') +new=$(echo ${var:0:1}`echo ${var:1} | tr '014589bc' '2367abef'`) + +if [ ${var:0:1}${var:1} == $new ]; then + echo "Your eeprom is up to date, no changes were made" + exit 2 +fi + +echo "executing command: ethtool -E $1 magic $dev offset 0x1e value 0x$new" +ethtool -E $1 magic $dev offset 0x1e value 0x$new + +echo "Change made. You *MUST* reboot your machine before changes take effect!" diff --git a/cookbooks/devices/recipes/default.rb b/cookbooks/devices/recipes/default.rb index 18719778d..79f24c9d7 100644 --- a/cookbooks/devices/recipes/default.rb +++ b/cookbooks/devices/recipes/default.rb @@ -17,6 +17,12 @@ # limitations under the License. # +cookbook_file "/usr/local/bin/fixeep-82574_83.sh" do + owner "root" + group "root" + mode 0o755 +end + execute "udevadm-trigger" do action :nothing command "/sbin/udevadm trigger --action=add" diff --git a/cookbooks/devices/templates/default/udev.rules.erb b/cookbooks/devices/templates/default/udev.rules.erb index 114de0d51..e6d5a7e81 100644 --- a/cookbooks/devices/templates/default/udev.rules.erb +++ b/cookbooks/devices/templates/default/udev.rules.erb @@ -28,6 +28,9 @@ ACTION=="add", SUBSYSTEM=="block", ENV{ID_BUS}=="<%= device[:bus] %>", ENV{ID_SE # Disable scatter-gather offload for HP NC362i network controllers SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x10c9", ATTRS{subsystem_vendor}=="0x103c", ATTRS{subsystem_device}=="0x323f", RUN+="/sbin/ethtool -K $name gso off tso off sg off gro off" +# Fix Power Saving Bug on Intel 82574L network controller in Supermicro HPC machines +SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x10d3", ATTRS{subsystem_vendor}=="0x15d9", ATTRS{subsystem_device}=="0x10d3", RUN+="/usr/local/bin/fixeep-82574_83.sh $name" + # Workaround unreliable Western Digital WD RE3/RE4 disks (ATA only) # Set sufficent Linux subsystem timeout ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="ata", ENV{ID_MODEL}=="WDC_WD1002FBYS-02A6B0", ATTR{device/timeout}="90" -- 2.43.2