From 5e909f9dd17d10001adaa89b6e60caa7bd7eb126 Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Mon, 5 Aug 2024 10:14:38 -0700 Subject: [PATCH] SER Support (#1993) Signed-off-by: JaiOCP Signed-off-by: siqbal1986 --- inc/saitypes.h | 129 +++++++++++++++++++++++++++++++++++++++++++++- meta/acronyms.txt | 1 + 2 files changed, 129 insertions(+), 1 deletion(-) diff --git a/inc/saitypes.h b/inc/saitypes.h index f34c30c97..6d67c743b 100644 --- a/inc/saitypes.h +++ b/inc/saitypes.h @@ -1813,14 +1813,141 @@ typedef enum _sai_object_stage_t typedef enum _sai_health_data_type_t { /** General health data type */ - SAI_HEALTH_DATA_TYPE_GENERAL + SAI_HEALTH_DATA_TYPE_GENERAL, + + /** SER health data type */ + SAI_HEALTH_DATA_TYPE_SER } sai_health_data_type_t; +typedef enum _sai_ser_type_t +{ + /** + * @brief Unknown error type + */ + SAI_SER_TYPE_UNKNOWN = 0, + + /** + * @brief Parity error + */ + SAI_SER_TYPE_PARITY = 1, + + /** + * @brief ECC single bit error + */ + SAI_SER_TYPE_ECC_SINGLE_BIT = 2, + + /** + * @brief ECC double bit error + */ + SAI_SER_TYPE_ECC_DOUBLE_BIT = 3, +} sai_ser_type_t; + +typedef enum _sai_ser_correction_type_t +{ + /** + * @brief SW takes no action when error happens + */ + SAI_SER_CORRECTION_TYPE_NO_ACTION = 0, + + /** + * @brief SW tries to correct but fails + */ + SAI_SER_CORRECTION_TYPE_FAIL_TO_CORRECT = 1, + + /** + * @brief SW writes NULL entry to clear the error + */ + SAI_SER_CORRECTION_TYPE_ENTRY_CLEAR = 2, + + /** + * @brief Restore entry from SW cache + */ + SAI_SER_CORRECTION_TYPE_SW_CACHE_RESTORE = 3, + + /** + * @brief Restore entry from HW cache + */ + SAI_SER_CORRECTION_TYPE_HW_CACHE_RESTORE = 4, + + /** + * @brief Memory needs special correction handling + */ + SAI_SER_CORRECTION_TYPE_SPECIAL = 5, +} sai_ser_correction_type_t; + +/** + * @brief SAI SER log information type + * + * @flags strict + */ +typedef enum _sai_ser_log_type_t +{ + /** + * @brief Error happens on memory + */ + SAI_SER_LOG_TYPE_MEM = 1 << 0, + + /** + * @brief Error happens on register + */ + SAI_SER_LOG_TYPE_REG = 1 << 1, + + /** + * @brief Parity errors detected more than once + */ + SAI_SER_LOG_TYPE_MULTI = 1 << 2, + + /** + * @brief Error corrected by SW + */ + SAI_SER_LOG_TYPE_CORRECTED = 1 << 3, + + /** + * @brief Restore entry from HW cache + */ + SAI_SER_LOG_TYPE_ENTRY_INFO = 1 << 4, + + /** + * @brief Cache data is valid + */ + SAI_SER_LOG_TYPE_CACHE = 1 << 5, +} sai_ser_log_type_t; + +typedef struct _sai_ser_health_data_t +{ + /** SER type specific fields */ + sai_ser_type_t type; + + /** SER correction type specific fields */ + sai_ser_correction_type_t correction_type; + + /** + * @brief SER correction log info (sai_ser_log_type_t) + * + * For example, if entry info is present and is coming from cache + * SAI_SER_LOG_TYPE_ENTRY_INFO | SAI_SER_LOG_TYPE_CACHE + * + * @flags sai_ser_log_type_t + */ + uint32_t ser_log_type; +} sai_ser_health_data_t; + +/** + * @extraparam sai_health_data_type_t data_type + */ +typedef union _sai_health_data_t +{ + /** @validonly data_type == SAI_HEALTH_DATA_TYPE_SER */ + sai_ser_health_data_t ser; +} sai_health_data_t; + typedef struct _sai_switch_health_data_t { /** Type of switch health data */ sai_health_data_type_t data_type; + /** @passparam data_type */ + sai_health_data_t data; } sai_switch_health_data_t; /** diff --git a/meta/acronyms.txt b/meta/acronyms.txt index f37df03d8..3e48145a7 100644 --- a/meta/acronyms.txt +++ b/meta/acronyms.txt @@ -135,6 +135,7 @@ SAK - Secure Association Key SC - Secure Channel SCI - Secure Channel Identifier SDK - Software Development Kit +SER - Soft Error Rate SFI - SerDes Framer Interface SFLOW - Sampled Flow SG - (S,G) Source-specific multicast