Skip to content

Commit be623b9

Browse files
qat, initcontainer: add enablement of auto_reset
Signed-off-by: Hyeongju Johannes Lee <[email protected]>
1 parent 4ca9eb9 commit be623b9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

demo/qat-init.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ enable_sriov() {
6666
done
6767
}
6868

69+
70+
enable_auto_reset() {
71+
for dev in $DEVS; do
72+
DEVPATH="/sys/bus/pci/devices/0000:$dev"
73+
AUTORESET="$DEVPATH/qat/auto_reset"
74+
if ! test -w "$AUTORESET"; then
75+
echo "error: $AUTORESET is not found or not writable. Check if QAT driver module is loaded"
76+
exit 1
77+
fi
78+
if [ "$(cat "$AUTORESET")" == "on" ]; then
79+
echo "$DEVPATH's auto reset is already on"
80+
else
81+
echo "on" > "$AUTORESET" && echo "$DEVPATH's auto reset has been enabled"
82+
fi
83+
done
84+
}
85+
6986
check_config
7087
sysfs_config
7188
enable_sriov
89+
enable_auto_reset

0 commit comments

Comments
 (0)