From c63fe6a5fcfc906699fb5d5ee8475f8de1da7b29 Mon Sep 17 00:00:00 2001 From: Chris Freehill Date: Thu, 4 Apr 2019 15:27:15 -0500 Subject: [PATCH] Add "Disabled" state to ECC states [ROCm/amdsmi commit: 84e3c541d1464177d0a03782191c3705f29c8db8] --- projects/amdsmi/include/rocm_smi/rocm_smi.h | 1 + projects/amdsmi/src/rocm_smi.cc | 1 + .../rocm_smi_test/functional/err_cnt_read.cc | 2 +- .../amdsmi/tests/rocm_smi_test/test_common.cc | 30 +++++++++++++++---- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/projects/amdsmi/include/rocm_smi/rocm_smi.h b/projects/amdsmi/include/rocm_smi/rocm_smi.h index c54c1b4f91..5b9dd47a07 100755 --- a/projects/amdsmi/include/rocm_smi/rocm_smi.h +++ b/projects/amdsmi/include/rocm_smi/rocm_smi.h @@ -253,6 +253,7 @@ typedef rsmi_gpu_block_t rsmi_gpu_block; */ typedef enum { RSMI_RAS_ERR_STATE_NONE = 0, //!< No current errors + RSMI_RAS_ERR_STATE_DISABLED, //!< ECC is disabled RSMI_RAS_ERR_STATE_PARITY, //!< ECC errors present, but type unknown RSMI_RAS_ERR_STATE_SING_C, //!< Single correctable error RSMI_RAS_ERR_STATE_MULT_UC, //!< Multiple uncorrectable errors diff --git a/projects/amdsmi/src/rocm_smi.cc b/projects/amdsmi/src/rocm_smi.cc index 4fd9ae5fc9..4ddad121ff 100755 --- a/projects/amdsmi/src/rocm_smi.cc +++ b/projects/amdsmi/src/rocm_smi.cc @@ -485,6 +485,7 @@ static_assert(RSMI_GPU_BLOCK_LAST == RSMI_GPU_BLOCK_GFX, static const std::map kRocmSMIStateMap = { {"none", RSMI_RAS_ERR_STATE_NONE}, + {"disabled", RSMI_RAS_ERR_STATE_DISABLED}, {"parity", RSMI_RAS_ERR_STATE_PARITY}, {"single_correctable", RSMI_RAS_ERR_STATE_SING_C}, {"multi_uncorrectable", RSMI_RAS_ERR_STATE_MULT_UC}, diff --git a/projects/amdsmi/tests/rocm_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/rocm_smi_test/functional/err_cnt_read.cc index 675ce17f42..8f6a9ac26a 100755 --- a/projects/amdsmi/tests/rocm_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/rocm_smi_test/functional/err_cnt_read.cc @@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) { } else { CHK_ERR_ASRT(err) IF_VERB(STANDARD) { - std::cout << "\t**Error count status for " << + std::cout << "\t**Error Count status for " << GetBlockNameStr(static_cast(b)) << " block: " << GetErrStateNameStr(err_state) << std::endl; } diff --git a/projects/amdsmi/tests/rocm_smi_test/test_common.cc b/projects/amdsmi/tests/rocm_smi_test/test_common.cc index c8688b23b8..837f97b57f 100755 --- a/projects/amdsmi/tests/rocm_smi_test/test_common.cc +++ b/projects/amdsmi/tests/rocm_smi_test/test_common.cc @@ -63,12 +63,32 @@ static const std::map kBlockNameMap = { static_assert(RSMI_GPU_BLOCK_LAST == RSMI_GPU_BLOCK_GFX, "kBlockNameMap needs to be updated"); +static const char * kRasErrStateStrings[] = { + "None", // RSMI_RAS_ERR_STATE_NONE + "Disabled", // RSMI_RAS_ERR_STATE_DISABLED + "Error Unknown", // RSMI_RAS_ERR_STATE_PARITY + "Single, Correctable", // RSMI_RAS_ERR_STATE_SING_C + "Multiple, Uncorrectable", // RSMI_RAS_ERR_STATE_MULT_UC + "Poison" // RSMI_RAS_ERR_STATE_POISON +}; +static_assert( + sizeof(kRasErrStateStrings)/sizeof(char *) == (RSMI_RAS_ERR_STATE_LAST + 1), + "kErrStateNameMap needs to be updated"); + + static const std::map kErrStateNameMap = { - {RSMI_RAS_ERR_STATE_NONE, "None"}, - {RSMI_RAS_ERR_STATE_PARITY, "Error Unknown"}, - {RSMI_RAS_ERR_STATE_SING_C, "Single, Correctable"}, - {RSMI_RAS_ERR_STATE_MULT_UC, "Multiple, Uncorrectable"}, - {RSMI_RAS_ERR_STATE_POISON, "Poison"}, + {RSMI_RAS_ERR_STATE_NONE, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_NONE]}, + {RSMI_RAS_ERR_STATE_DISABLED, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_DISABLED]}, + {RSMI_RAS_ERR_STATE_PARITY, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_PARITY]}, + {RSMI_RAS_ERR_STATE_SING_C, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_SING_C]}, + {RSMI_RAS_ERR_STATE_MULT_UC, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_MULT_UC]}, + {RSMI_RAS_ERR_STATE_POISON, + kRasErrStateStrings[RSMI_RAS_ERR_STATE_POISON]}, }; static_assert(RSMI_RAS_ERR_STATE_LAST == RSMI_RAS_ERR_STATE_POISON, "kErrStateNameMap needs to be updated");