Commit 13d01bed authored by Michal Berger's avatar Michal Berger Committed by Jim Harris
Browse files

scripts/common: Use proper format of the pci address for pciconf



If devices are not picked up from the cache, iter_all_pci_class_code()
will pick lspci in first instance to iterate over the pci bus. If said
tool is installed on FreeBSD, it will return BDFs in format which won't
be understood by pciconf (which is used to determine which driver given
device is bound to):

  pciconf: cannot parse selector pci0000:00:06.0

To make sure pciconf understands the argument it's given, simply
replace .function with :function (0000:00:06.0 -> 0000:00:06:0).

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 94067e8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ function nvme_in_userspace() {

	for bdf in "${nvmes[@]}"; do
		if [[ -e /sys/bus/pci/drivers/nvme/$bdf ]] \
			|| [[ $(uname -s) == FreeBSD && $(pciconf -l "pci$bdf") == nvme* ]]; then
			|| [[ $(uname -s) == FreeBSD && $(pciconf -l "pci${bdf/./:}") == nvme* ]]; then
			continue
		fi
		bdfs+=("$bdf")