aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2020-11-03 15:45:03 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2021-01-31 22:35:47 +1100
commit38132cc0e5a6b22b04fac2e4df25c59435fcd6de (patch)
tree637a6993c6711af7462efc03f8558a7740171473 /tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh
parentselftests/powerpc: Use stderr for debug messages in eeh-functions (diff)
downloadwireguard-linux-38132cc0e5a6b22b04fac2e4df25c59435fcd6de.tar.xz
wireguard-linux-38132cc0e5a6b22b04fac2e4df25c59435fcd6de.zip
selftests/powerpc: Add VF recovery tests
The basic EEH test ignores VFs since we the way the eeh_dev_break debugfs interface works means that if multiple VFs are enabled we may cause errors on all them them. However, we can work around that by only enabling a single VF at a time. This patch adds some infrastructure for finding SR-IOV capable devices and enabling / disabling VFs so we can exercise the VF specific EEH recovery paths. Two new tests are added, one for testing EEH aware devices and one for EEH un-aware VFs. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201103044503.917128-3-oohall@gmail.com
Diffstat (limited to 'tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh')
-rwxr-xr-xtools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh b/tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh
new file mode 100755
index 000000000000..8a4c147b9d43
--- /dev/null
+++ b/tools/testing/selftests/powerpc/eeh/eeh-vf-unaware.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+
+. ./eeh-functions.sh
+
+eeh_test_prep # NB: may exit
+
+vf_list="$(eeh_enable_vfs)";
+if $? != 0 ; then
+ log "No usable VFs found. Skipping EEH unaware VF test"
+ exit $KSELFTESTS_SKIP;
+fi
+
+log "Enabled VFs: $vf_list"
+
+failed=0
+for vf in $vf_list ; do
+ log "Testing $vf"
+
+ if eeh_can_recover $vf ; then
+ log "Driver for $vf supports error recovery. Unbinding..."
+ echo "$vf" > /sys/bus/pci/devices/$vf/driver/unbind
+ fi
+
+ log "Breaking $vf..."
+ if ! eeh_one_dev $vf ; then
+ log "$vf failed to recover"
+ failed="$((failed + 1))"
+ fi
+done
+
+eeh_disable_vfs
+
+test "$failed" != 0
+exit $?;