From 9801533f8a7da71138766dd37674aff3671fa095 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 26 Nov 2020 18:56:05 +0100 Subject: [PATCH] scripts/setup: Use uio_pci_generic if it's loaded/compiled in Also, for consistency, use check_for_driver() while checking if igb_uio is loaded too. Change-Id: I00302b3cab169c77032fc0cef0ea384e9e5eb5be Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5303 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- scripts/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 8f47583a2e..a2319ec710 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -139,7 +139,7 @@ function linux_bind_driver() { echo "$ven_dev_id" > "/sys/bus/pci/drivers/$driver_name/new_id" 2> /dev/null || true echo "$bdf" > "/sys/bus/pci/drivers/$driver_name/bind" 2> /dev/null || true - if [[ $driver_name == uio_pci_generic && -e /sys/module/igb_uio ]]; then + if [[ $driver_name == uio_pci_generic ]] && ! check_for_driver igb_uio; then # Check if the uio_pci_generic driver is broken as it might be in # some 4.18.x kernels (see centos8 for instance) - if our device # didn't get a proper uio entry, fallback to igb_uio @@ -315,7 +315,7 @@ function configure_linux_pci() { if modinfo vfio_iommu_type1 > /dev/null; then modprobe vfio_iommu_type1 fi - elif modinfo uio_pci_generic > /dev/null 2>&1; then + elif ! check_for_driver uio_pci_generic || modinfo uio_pci_generic > /dev/null 2>&1; then driver_name=uio_pci_generic elif [[ -e $igb_uio_fallback ]]; then driver_path="$igb_uio_fallback"