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 <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/395945
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-01-23 16:07:56 +01:00 committed by Jim Harris
parent 074f4d7627
commit 2a68832d5c

View File

@ -285,6 +285,10 @@ function reset_linux_pci {
driver_loaded=$? driver_loaded=$?
set -e set -e
for bdf in $(iter_pci_class_code 01 08 02); do 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 if [ $driver_loaded -eq 0 ]; then
linux_bind_driver "$bdf" nvme linux_bind_driver "$bdf" nvme
else else
@ -304,6 +308,10 @@ function reset_linux_pci {
set -e set -e
for dev_id in `cat $TMP`; do for dev_id in `cat $TMP`; do
for bdf in $(iter_pci_dev_id 8086 $dev_id); 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 if [ $driver_loaded -eq 0 ]; then
linux_bind_driver "$bdf" ioatdma linux_bind_driver "$bdf" ioatdma
else else
@ -326,6 +334,10 @@ function reset_linux_pci {
modprobe virtio-pci || true modprobe virtio-pci || true
for dev_id in `cat $TMP`; do for dev_id in `cat $TMP`; do
for bdf in $(iter_pci_dev_id 1af4 $dev_id); 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 linux_bind_driver "$bdf" virtio-pci
done done
done done