intel-device-plugins-for-ku.../demo/qat-init.sh
Hyeongju Johannes Lee df419b3a82 qat: add initimage to plugin
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-03-30 13:46:42 -07:00

12 lines
379 B
Bash
Executable File

#!/bin/bash
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940}
DEVS=$(for pf in $ENABLED_QAT_PF_PCIIDS; do lspci -n | grep -e "$pf" | grep -o -e "^\\S*"; done)
for dev in $DEVS; do
DEVPATH="/sys/bus/pci/devices/0000:$dev"
NUMVFS="$DEVPATH/sriov_numvfs"
if test -w "$NUMVFS" -a "$(cat "$NUMVFS")" -eq 0 ; then
tee "$NUMVFS" < "$DEVPATH/sriov_totalvfs"
fi
done