From 0922ffd67962a4a9bd126bb9611307afbdcae6d9 Mon Sep 17 00:00:00 2001 From: qwang59 Date: Fri, 26 Jul 2024 10:17:26 +0800 Subject: [PATCH] Add NUMA node exception check for CXL device Signed-off-by: qwang59 --- BM/topology/cpu_topology.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BM/topology/cpu_topology.sh b/BM/topology/cpu_topology.sh index d568b71f..4fc057cc 100755 --- a/BM/topology/cpu_topology.sh +++ b/BM/topology/cpu_topology.sh @@ -14,6 +14,8 @@ LL3_VALUE="" DIE_VALUE="" SNC_VALUE="" LL3_PER_SOCKET="" +CXL_DEVICE="" +CXL_MEM="" : "${CASE_NAME:=""}" @@ -25,6 +27,12 @@ usage() { __EOF } +CXL_DEVICE=$(lspci | grep CXL 2>&1) +[[ -n "$CXL_DEVICE" ]] && test_print_trc "CXL device is available." + +CXL_MEM=$(grep CXL /proc/iomem 2>&1) +[[ -n "$CXL_MEM" ]] && test_print_trc "CXL memory is available." + # cpuid tool is required to run cases if which cpuid 1>/dev/null 2>&1; then cpuid 1>/dev/null || block_test "Failed to run cpuid tool, @@ -225,6 +233,8 @@ socket_num() { [[ $numa_num -eq $snc_enabled_pkg_num_two ]] || [[ $numa_num -eq $snc_enabled_pkg_num_three ]] then test_print_trc "SNC is enabled, sockets and NUMA Nodes number is expected." + elif [[ -n "$CXL_DEVICE" ]] && [[ -n "$CXL_MEM" ]]; then + test_print_trc "CXL device is available, sockets and NUMA Nodes number is expected." else die "socket number is not aligned between lspci and sysfs" fi