From 15f52aec2f1b46e50852dfff8587c76d26971dbc Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 7 May 2020 10:40:44 +0200 Subject: [PATCH] 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: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2229 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/setup.sh b/scripts/setup.sh index d973693079..77341abd6e 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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