File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ QAT_420XX_DEVICE_PCI_ID="0x4946"
11
11
SERVICES_ENABLED=" NONE"
12
12
SERVICES_ENABLED_FOUND=" FALSE"
13
13
14
+ AUTORESET_ENABLED=" NONE"
15
+ AUTORESET_ENABLED_FOUND=" FALSE"
16
+ AUTORESET_OPTIONS_LIST=" on off"
17
+
14
18
check_config () {
15
19
enabled_config=" NONE"
16
20
[ -f " conf/qat.conf" ] && enabled_config=$( grep " ^$1 =" conf/qat.conf | cut -d= -f 2 | grep ' \S' )
@@ -79,7 +83,29 @@ enable_sriov() {
79
83
done
80
84
}
81
85
86
+ enable_auto_reset () {
87
+ if [ " $AUTORESET_ENABLED_FOUND " = " TRUE" ]; then
88
+ for dev in $DEVS ; do
89
+ DEVPATH=" /sys/bus/pci/devices/0000:$dev "
90
+ AUTORESET_PATH=" $DEVPATH /qat/auto_reset"
91
+ if ! test -w " $AUTORESET_PATH " ; then
92
+ echo " error: $AUTORESET_PATH is not found or not writable. Check if QAT driver module is loaded. Skipping..."
93
+ exit 1
94
+ fi
95
+ if [ " $( cat " $AUTORESET_PATH " ) " == " $AUTORESET_ENABLED " ]; then
96
+ echo " $DEVPATH 's auto reset is already $AUTORESET_ENABLED "
97
+ else
98
+ echo " $AUTORESET_ENABLED " > " $AUTORESET_PATH " && echo " $DEVPATH 's auto reset has been set $AUTORESET_ENABLED "
99
+ fi
100
+ done
101
+ fi
102
+ }
103
+
82
104
SERVICES_ENABLED=$( check_config " ServicesEnabled" " $SERVICES_LIST " )
83
105
SERVICES_ENABLED_FOUND=$( is_found " $SERVICES_ENABLED " )
84
106
sysfs_config
85
107
enable_sriov
108
+
109
+ AUTORESET_ENABLED=$( check_config " AutoresetEnabled" " $AUTORESET_OPTIONS_LIST " )
110
+ AUTORESET_ENABLED_FOUND=$( is_found " $AUTORESET_ENABLED " )
111
+ enable_auto_reset
You can’t perform that action at this time.
0 commit comments