From 2a68832d5cc6a0668917496fd57c11f9715f2204 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Tue, 23 Jan 2018 16:07:56 +0100 Subject: [PATCH] setup.sh: obey PCI_WHITELIST in `./setup.sh reset` It is now possible to reset only particular PCI devices. Change-Id: Ic45be5e7e16cf4736c742b14fc0d709788a3b3f1 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/395945 Reviewed-by: Ben Walker Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- scripts/setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/setup.sh b/scripts/setup.sh index 628740307..62bb3dc6c 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -285,6 +285,10 @@ function reset_linux_pci { driver_loaded=$? set -e for bdf in $(iter_pci_class_code 01 08 02); do + if pci_can_bind $bdf == "0" ; then + echo "Skipping un-whitelisted NVMe controller $blkname ($bdf)" + continue + fi if [ $driver_loaded -eq 0 ]; then linux_bind_driver "$bdf" nvme else @@ -304,6 +308,10 @@ function reset_linux_pci { set -e for dev_id in `cat $TMP`; do for bdf in $(iter_pci_dev_id 8086 $dev_id); do + if pci_can_bind $bdf == "0" ; then + echo "Skipping un-whitelisted I/OAT device at $bdf" + continue + fi if [ $driver_loaded -eq 0 ]; then linux_bind_driver "$bdf" ioatdma else @@ -326,6 +334,10 @@ function reset_linux_pci { modprobe virtio-pci || true for dev_id in `cat $TMP`; do for bdf in $(iter_pci_dev_id 1af4 $dev_id); do + if pci_can_bind $bdf == "0" ; then + echo "Skipping un-whitelisted Virtio device at $bdf" + continue + fi linux_bind_driver "$bdf" virtio-pci done done