intel-device-plugins-for-ku.../demo/qat-init.sh
Mikko Ylinen 8987f1ba53 qat: add support for 401xx devices
QAT_401xx is a derivative of 4xxx. Add support for that device
by including the device IDs (both PF and VF).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-06-02 08:11:39 +03:00

12 lines
384 B
Bash
Executable File

#!/bin/bash
ENABLED_QAT_PF_PCIIDS=${ENABLED_QAT_PF_PCIIDS:-37c8 4940 4942}
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