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"
1111SERVICES_ENABLED=" NONE"
1212SERVICES_ENABLED_FOUND=" FALSE"
1313
14+ AUTORESET_ENABLED=" NONE"
15+ AUTORESET_ENABLED_FOUND=" FALSE"
16+ AUTORESET_OPTIONS_LIST=" on off"
17+
1418check_config () {
1519 enabled_config=" NONE"
1620 [ -f " conf/qat.conf" ] && enabled_config=$( grep " ^$1 =" conf/qat.conf | cut -d= -f 2 | grep ' \S' )
@@ -79,7 +83,29 @@ enable_sriov() {
7983 done
8084}
8185
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+
82104SERVICES_ENABLED=$( check_config " ServicesEnabled" " $SERVICES_LIST " )
83105SERVICES_ENABLED_FOUND=$( is_found " $SERVICES_ENABLED " )
84106sysfs_config
85107enable_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