From 13d01bed16c135e1527e7e4d1dc5358b3830f335 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 14 Oct 2020 13:52:59 +0200 Subject: [PATCH] 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: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4665 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common.sh b/scripts/common.sh index 60de90080..10dcd4d62 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -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")