From 2f6afea6629eb64177aaeeed47466ca0a5214dfc Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 2 Dec 2020 12:48:18 +0100 Subject: [PATCH] scripts/qat_setup: Be more verbose about SR-IOV setup If the sriov_numvfs sysfs attr is not available for given controller report that. Also, verify if number of VFs matches initial value of 16 devices. If not, report that as well. This number was also being overwritten with the set value from previous device - this could false-positive the confirm check so keep the set value in a seperate variable. Change-Id: I518464518dd75585c4692c8ec1b3268e798dcf6c Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5414 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Community-CI: Mellanox Build Bot --- scripts/qat_setup.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/qat_setup.sh b/scripts/qat_setup.sh index 30e24ca09..e119f9cc3 100755 --- a/scripts/qat_setup.sh +++ b/scripts/qat_setup.sh @@ -41,9 +41,17 @@ fi # configure virtual functions for the QAT cards. for qat_bdf in "${qat_pci_bdfs[@]}"; do + if [[ ! -e /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs ]]; then + echo "($qat_bdf) sriov_numvfs interface missing, is SR-IOV enabled?" + continue + fi echo "$num_vfs" > /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs - num_vfs=$(cat /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs) - echo "$qat_bdf set to $num_vfs VFs" + num_vfs_set=$(cat /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs) + if ((num_vfs != num_vfs_set)); then + echo "Number of VFs set to $num_vfs_set, expected $num_vfs" + else + echo "$qat_bdf set to $num_vfs VFs" + fi done # Confirm we have all of the virtual functions we asked for.