Commit b44bbd24 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

scripts/setup: Use cached info about the iommu_groups



Change-Id: Ia64c374aa16aed9c22c8ca1619deb674e951d4c6
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20957


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 3ac0a6ed
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -175,16 +175,16 @@ function linux_bind_driver() {

	probe_driver "$bdf" "$driver_name"

	iommu_group=$(basename $(readlink -f /sys/bus/pci/devices/$bdf/iommu_group))
	local iommu_group=${pci_iommu_groups["$bdf"]}
	if [ -e "/dev/vfio/$iommu_group" ]; then
		if [ -n "$TARGET_USER" ]; then
			chown "$TARGET_USER" "/dev/vfio/$iommu_group"
		fi
	fi

	local iommug=("/sys/bus/pci/devices/$bdf/iommu_group/devices/"!($bdf))
	local iommug=("${!iommu_groups[iommu_group]}")
	local _bdf _driver
	if ((${#iommug[@]} > 0)) && [[ $driver_name == vfio* ]]; then
	if ((${#iommug[@]} > 1)) && [[ $driver_name == vfio* ]]; then
		pci_dev_echo "$bdf" "WARNING: detected multiple devices (${#iommug[@]}) under the same IOMMU group!"
		for _bdf in "${iommug[@]}"; do
			_driver=$(readlink -f "$_bdf/driver")