From ee18a02e15191d600ca7c13bf4b42ee23b63526d Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Tue, 17 Sep 2024 03:47:55 -0700 Subject: [PATCH] qat, initcontainer: add enablement of auto_reset Signed-off-by: Hyeongju Johannes Lee --- demo/qat-init.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/demo/qat-init.sh b/demo/qat-init.sh index 970fb153d..e6df5ef73 100755 --- a/demo/qat-init.sh +++ b/demo/qat-init.sh @@ -66,6 +66,24 @@ enable_sriov() { done } + +enable_auto_reset() { + for dev in $DEVS; do + DEVPATH="/sys/bus/pci/devices/0000:$dev" + AUTORESET="$DEVPATH/qat/auto_reset" + if ! test -w "$AUTORESET"; then + echo "warning: $AUTORESET is not found or not writable. Check if QAT driver module is loaded. Skipping..." + return + fi + if [ "$(cat "$AUTORESET")" == "on" ]; then + echo "$DEVPATH's auto reset is already on" + else + echo "on" > "$AUTORESET" && echo "$DEVPATH's auto reset has been enabled" + fi + done +} + check_config sysfs_config enable_sriov +enable_auto_reset