Commit 6fc5e718 authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

scripts/gen_nvme: don't use disks with nvme driver



Disks with NVMe driver were probably not whitelisted before.
Do not add them to NVMe subsystem configuration.

Change-Id: I9418590f5562a96750685d101323b60e56cc90cb
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/438426


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 814f6331
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ set -e
rootdir=$(readlink -f $(dirname $0))/..
source "$rootdir/scripts/common.sh"

bdfs=($(iter_pci_class_code 01 08 02))
function create_classic_config()
{
	echo "[Nvme]"
@@ -39,6 +38,17 @@ function create_json_config()
	echo '}'
}

bdfs=()
# Check used drivers. If it's not vfio-pci or uio-pci-generic
# then most likely PCI_WHITELIST option was used for setup.sh
# and we do not want to use that disk.
for bdf in $(iter_pci_class_code 01 08 02); do
	driver=`grep DRIVER /sys/bus/pci/devices/$bdf/uevent | awk -F"=" '{print $2}'`
	if [ "$driver" != "nvme" ]; then
		bdfs+=("$bdf")
	fi
done

if [ "$1" = "--json" ]; then
	create_json_config
else