Skip to content

Commit

Permalink
Add NUMA node exception check for CXL device
Browse files Browse the repository at this point in the history
Signed-off-by: qwang59 <[email protected]>
  • Loading branch information
qwang59 committed Jul 26, 2024
1 parent 15ea123 commit 0922ffd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions BM/topology/cpu_topology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ LL3_VALUE=""
DIE_VALUE=""
SNC_VALUE=""
LL3_PER_SOCKET=""
CXL_DEVICE=""
CXL_MEM=""

: "${CASE_NAME:=""}"

Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0922ffd

Please sign in to comment.