scripts/setup: Check if VMD controllers are allowed to be used
Recent refactors removed the behavior introduced with a6edaa9600
.
Bring it back and don't try to rebind the VMD devices if they were
not explicitliy allowed in the setup.
Also, shuffle the code a bit and put verification pieces under one
block where $mode is being determined.
Change-Id: Ie2cc41e402f20147b98ab288d623ac76a4472839
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4398
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
ebc227d9b2
commit
b9ba32aa63
@ -190,15 +190,23 @@ function collect_devices() {
|
|||||||
[[ $dev_type =~ (NVME|IOAT|IDXD|VIRTIO|VMD) ]] && dev_type=${BASH_REMATCH[1],,}
|
[[ $dev_type =~ (NVME|IOAT|IDXD|VIRTIO|VMD) ]] && dev_type=${BASH_REMATCH[1],,}
|
||||||
for bdf in "${bdfs[@]}"; do
|
for bdf in "${bdfs[@]}"; do
|
||||||
in_use=0
|
in_use=0
|
||||||
if [[ $1 != status ]] && ! pci_can_use "$bdf"; then
|
if [[ $1 != status ]]; then
|
||||||
pci_dev_echo "$bdf" "Skipping un-whitelisted controller at $bdf"
|
if ! pci_can_use "$bdf"; then
|
||||||
|
pci_dev_echo "$bdf" "Skipping denied controller at $bdf"
|
||||||
in_use=1
|
in_use=1
|
||||||
fi
|
fi
|
||||||
if [[ $1 != status ]] && [[ $dev_type == nvme || $dev_type == virtio ]]; then
|
if [[ $dev_type == nvme || $dev_type == virtio ]]; then
|
||||||
if ! verify_bdf_mounts "$bdf"; then
|
if ! verify_bdf_mounts "$bdf"; then
|
||||||
in_use=1
|
in_use=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ $dev_type == vmd ]]; then
|
||||||
|
if [[ $PCI_WHITELIST != *"$bdf"* ]]; then
|
||||||
|
pci_dev_echo "$bdf" "Skipping not allowed VMD controller at $bdf"
|
||||||
|
in_use=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
eval "${dev_type}_d[$bdf]=$in_use"
|
eval "${dev_type}_d[$bdf]=$in_use"
|
||||||
all_devices_d["$bdf"]=$in_use
|
all_devices_d["$bdf"]=$in_use
|
||||||
if [[ -e /sys/bus/pci/devices/$bdf/driver ]]; then
|
if [[ -e /sys/bus/pci/devices/$bdf/driver ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user