Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # SPDX-License-Identifier: GPL-2.0-only
0003 
0004 . ./eeh-functions.sh
0005 
0006 eeh_test_prep # NB: may exit
0007 
0008 vf_list="$(eeh_enable_vfs)";
0009 if $? != 0 ; then
0010         log "No usable VFs found. Skipping EEH unaware VF test"
0011         exit $KSELFTESTS_SKIP;
0012 fi
0013 
0014 log "Enabled VFs: $vf_list"
0015 
0016 tested=0
0017 passed=0
0018 for vf in $vf_list ; do
0019         log "Testing $vf"
0020 
0021         if ! eeh_can_recover $vf ; then
0022                 log "Driver for $vf doesn't support error recovery, skipping"
0023                 continue;
0024         fi
0025 
0026         tested="$((tested + 1))"
0027 
0028         log "Breaking $vf..."
0029         if ! eeh_one_dev $vf ; then
0030                 log "$vf failed to recover"
0031                 continue;
0032         fi
0033 
0034         passed="$((passed + 1))"
0035 done
0036 
0037 eeh_disable_vfs
0038 
0039 if [ "$tested" == 0 ] ; then
0040         echo "No VFs with EEH aware drivers found, skipping"
0041         exit $KSELFTESTS_SKIP
0042 fi
0043 
0044 test "$failed" != 0
0045 exit $?;