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

setup.sh: Watch for NUMA_NO_NODE value



The -1 is valid value indicating that the node id for given device
has not been specified. Detect it and map it to "unknown".

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


Community-CI: Mellanox Build Bot
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 5853749b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -612,6 +612,9 @@ function status_linux() {
			node="-"
		else
			node=$(cat /sys/bus/pci/devices/$bdf/numa_node)
			if ((node == -1)); then
				node=unknown
			fi
		fi
		device=$(cat /sys/bus/pci/devices/$bdf/device)
		vendor=$(cat /sys/bus/pci/devices/$bdf/vendor)
@@ -637,6 +640,9 @@ function status_linux() {
				node="-"
			else
				node=$(cat /sys/bus/pci/devices/$bdf/numa_node)
				if ((node == -1)); then
					node=unknown
				fi
			fi
			device=$(cat /sys/bus/pci/devices/$bdf/device)
			vendor=$(cat /sys/bus/pci/devices/$bdf/vendor)
@@ -679,6 +685,9 @@ function status_linux() {
				node="-"
			else
				node=$(cat /sys/bus/pci/devices/$bdf/numa_node)
				if ((node == -1)); then
					node=unknown
				fi
			fi
			device=$(cat /sys/bus/pci/devices/$bdf/device)
			vendor=$(cat /sys/bus/pci/devices/$bdf/vendor)
@@ -698,6 +707,9 @@ function status_linux() {
		for bdf in ${pci_bus_cache["0x8086:0x$dev_id"]}; do
			driver=$(grep DRIVER /sys/bus/pci/devices/$bdf/uevent | awk -F"=" '{print $2}')
			node=$(cat /sys/bus/pci/devices/$bdf/numa_node)
			if ((node == -1)); then
				node=unknown
			fi
			echo -e "$bdf\t$node\t\t$driver"
		done
	done