/*
 * Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#include "amd_smi/impl/amd_smi_gpu_device.h"
#include "amd_smi/impl/amd_smi_gpu_mutex.h"
#include "amd_smi/impl/amd_smi_system.h"
#include "amd_smi/impl/amd_smi_utils.h"
#include "rocm_smi/rocm_smi_logger.h"
#include "rocm_smi/rocm_smi_utils.h"

extern "C" {
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "ualoe_lib/ualoe_lib.h"
}

#include <algorithm>
#include <unordered_map>

/**
 * @brief Complete telemetry ID to string mapping using unordered_map for O(1) lookup
 */
static const std::unordered_map<uint64_t, const char*> telemetry_id_map = {
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_REQ, "IFOE_SDP_TX_PACK_WR_REQ"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_REQ, "IFOE_SDP_TX_PACK_RD_REQ"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ATM_REQ, "IFOE_SDP_TX_PACK_ATM_REQ"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA, "IFOE_SDP_TX_PACK_ORIG_DATA"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_PCL, "IFOE_SDP_TX_PACK_REQ_PCL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP, "IFOE_SDP_TX_PACK_WR_RSP"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP, "IFOE_SDP_TX_PACK_RD_RSP"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_EB_FULL, "IFOE_SDP_TX_PACK_REQ_EB_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_EB_EMPTY, "IFOE_SDP_TX_PACK_REQ_EB_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA_EB_FULL, "IFOE_SDP_TX_PACK_ORIG_DATA_EB_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA_EB_EMPTY, "IFOE_SDP_TX_PACK_ORIG_DATA_EB_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_EB_FULL, "IFOE_SDP_TX_PACK_WR_RSP_EB_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_EB_EMPTY, "IFOE_SDP_TX_PACK_WR_RSP_EB_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_EB_FULL, "IFOE_SDP_TX_PACK_RD_RSP_EB_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_EB_EMPTY, "IFOE_SDP_TX_PACK_RD_RSP_EB_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_PCL_FULL, "IFOE_SDP_TX_PACK_REQ_PCL_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_PCL_EMPTY, "IFOE_SDP_TX_PACK_REQ_PCL_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_PCL_FULL, "IFOE_SDP_TX_PACK_WR_RSP_PCL_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_PCL_EMPTY, "IFOE_SDP_TX_PACK_WR_RSP_PCL_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_PCL_FULL, "IFOE_SDP_TX_PACK_RD_RSP_PCL_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_PCL_EMPTY, "IFOE_SDP_TX_PACK_RD_RSP_PCL_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_POOL_FULL, "IFOE_SDP_TX_PACK_REQ_POOL_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_POOL_EMPTY, "IFOE_SDP_TX_PACK_REQ_POOL_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RSP_POOL_FULL, "IFOE_SDP_TX_PACK_RSP_POOL_FULL"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RSP_POOL_EMPTY, "IFOE_SDP_TX_PACK_RSP_POOL_EMPTY"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA_ERROR, "IFOE_SDP_TX_PACK_ORIG_DATA_ERROR"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_DATA_ERROR, "IFOE_SDP_TX_PACK_RD_RSP_DATA_ERROR"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_CREDIT_CONSUMED, "IFOE_SDP_TX_PACK_REQ_CREDIT_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_REQ_CREDIT_RELEASED, "IFOE_SDP_TX_PACK_REQ_CREDIT_RELEASED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA_CREDIT_CONSUMED,
     "IFOE_SDP_TX_PACK_ORIG_DATA_CREDIT_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_ORIG_DATA_CREDIT_RELEASED,
     "IFOE_SDP_TX_PACK_ORIG_DATA_CREDIT_RELEASED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_CREDIT_CONSUMED,
     "IFOE_SDP_TX_PACK_WR_RSP_CREDIT_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_WR_RSP_CREDIT_RELEASED,
     "IFOE_SDP_TX_PACK_WR_RSP_CREDIT_RELEASED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_CREDIT_CONSUMED,
     "IFOE_SDP_TX_PACK_RD_RSP_CREDIT_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_TX_PACK_RD_RSP_CREDIT_RELEASED,
     "IFOE_SDP_TX_PACK_RD_RSP_CREDIT_RELEASED"},
    {IFOE_TELEM_ID_IFOE_WENG_BSTATE_FREE_BLK_DELAY_REQ, "IFOE_WENG_BSTATE_FREE_BLK_DELAY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_BSTATE_FREE_BLK_DELAY_RES, "IFOE_WENG_BSTATE_FREE_BLK_DELAY_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_REQ, "IFOE_WENG_OP_SDP_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_RES, "IFOE_WENG_OP_SDP_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_FORCE_REQ, "IFOE_WENG_OP_SDP_FORCE_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_FORCE_RES, "IFOE_WENG_OP_SDP_FORCE_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_CHAIN_REQ, "IFOE_WENG_OP_SDP_CHAIN_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_CHAIN_RES, "IFOE_WENG_OP_SDP_CHAIN_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_WORD_REQ, "IFOE_WENG_OP_SDP_WORD_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_WORD_RES, "IFOE_WENG_OP_SDP_WORD_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_LENGTH_REQ, "IFOE_WENG_OP_SDP_LENGTH_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_LENGTH_RES, "IFOE_WENG_OP_SDP_LENGTH_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_PKT_OPEN_REQ, "IFOE_WENG_OP_SDP_PKT_OPEN_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_OP_SDP_PKT_OPEN_RES, "IFOE_WENG_OP_SDP_PKT_OPEN_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_PAYLOAD_REQ, "IFOE_WENG_EVICTION_PAYLOAD_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_PAYLOAD_RES, "IFOE_WENG_EVICTION_PAYLOAD_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_MTU_REQ, "IFOE_WENG_EVICTION_MTU_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_MTU_RES, "IFOE_WENG_EVICTION_MTU_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_REQ, "IFOE_WENG_EVICTION_FORCE_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_RES, "IFOE_WENG_EVICTION_FORCE_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_EXPIRY_REQ, "IFOE_WENG_EVICTION_EXPIRY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_EXPIRY_RES, "IFOE_WENG_EVICTION_EXPIRY_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_CHAIN_DELAY_REQ, "IFOE_WENG_EVICTION_CHAIN_DELAY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_CHAIN_DELAY_RES, "IFOE_WENG_EVICTION_CHAIN_DELAY_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_CHAIN_DELAY_REQ,
     "IFOE_WENG_EVICTION_FORCE_CHAIN_DELAY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_CHAIN_DELAY_RES,
     "IFOE_WENG_EVICTION_FORCE_CHAIN_DELAY_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_MTU_HOLD_DELAY_REQ, "IFOE_WENG_EVICTION_MTU_HOLD_DELAY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_MTU_HOLD_DELAY_RES, "IFOE_WENG_EVICTION_MTU_HOLD_DELAY_RES"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_HOLD_DELAY_REQ,
     "IFOE_WENG_EVICTION_FORCE_HOLD_DELAY_REQ"},
    {IFOE_TELEM_ID_IFOE_WENG_EVICTION_FORCE_HOLD_DELAY_RES,
     "IFOE_WENG_EVICTION_FORCE_HOLD_DELAY_RES"},
    {IFOE_TELEM_ID_IFOE_RENG_READ_SCH_IN, "IFOE_RENG_READ_SCH_IN"},
    {IFOE_TELEM_ID_IFOE_RENG_READ_PKT_OUT, "IFOE_RENG_READ_PKT_OUT"},
    {IFOE_TELEM_ID_IFOE_RENG_FREE_SCH_IN, "IFOE_RENG_FREE_SCH_IN"},
    {IFOE_TELEM_ID_IFOE_RENG_FREE_PKT_OUT, "IFOE_RENG_FREE_PKT_OUT"},
    {IFOE_TELEM_ID_IFOE_RENG_FREE_BLK_OUT, "IFOE_RENG_FREE_BLK_OUT"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_0,
     "IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_1,
     "IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_2,
     "IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_3,
     "IFOE_TX_ENCAP_PKT_EGRESS_XRSEC_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_0,
     "IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_1,
     "IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_2,
     "IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_3,
     "IFOE_TX_ENCAP_PAYL_LEN_EGRESS_XRSEC_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_0,
     "IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_1,
     "IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_2,
     "IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_3,
     "IFOE_TX_ENCAP_HDR_LEN_EGRESS_XRSEC_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_EGRESS_XRSEC, "IFOE_TX_ENCAP_VALID_EGRESS_XRSEC"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_STALL_EGRESS_XRSEC, "IFOE_TX_ENCAP_STALL_EGRESS_XRSEC"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_PKT_INGRESS, "IFOE_TX_ENCAP_PKT_INGRESS"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_INGRESS, "IFOE_TX_ENCAP_VALID_INGRESS"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_STALL_INGRESS, "IFOE_TX_ENCAP_STALL_INGRESS"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_0,
     "IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_1,
     "IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_2,
     "IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_3,
     "IFOE_TX_ENCAP_VALID_CNTXT_INGRESS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_ENCAP_STALL_CNTXT_INGRESS, "IFOE_TX_ENCAP_STALL_CNTXT_INGRESS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_INACTIVE_STREAMS, "IFOE_TX_SCHED_INACTIVE_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_ACTIVE_STREAMS, "IFOE_TX_SCHED_ACTIVE_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_PAUSED_STREAMS, "IFOE_TX_SCHED_PAUSED_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_BOOSTED_PRI_STREAMS, "IFOE_TX_SCHED_BOOSTED_PRI_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_EMPTY_QUEUE_STREAMS, "IFOE_TX_SCHED_EMPTY_QUEUE_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_EMPTY_SEND_QUEUE_STREAMS,
     "IFOE_TX_SCHED_EMPTY_SEND_QUEUE_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_REQ_PKTS, "IFOE_TX_SCHED_REQ_PKTS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_RES_PKTS, "IFOE_TX_SCHED_RES_PKTS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_0,
     "IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_0,
     "IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_0,
     "IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_0,
     "IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_1,
     "IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_1,
     "IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_1,
     "IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_1,
     "IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_2,
     "IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_2,
     "IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_2,
     "IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_2,
     "IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_3,
     "IFOE_TX_SCHED_LOW_PRI_REQ_PKTS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_3,
     "IFOE_TX_SCHED_HIGH_PRI_REQ_PKTS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_3,
     "IFOE_TX_SCHED_LOW_PRI_RES_PKTS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_3,
     "IFOE_TX_SCHED_HIGH_PRI_RES_PKTS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_ACTIVE_TX_ACK_RES_STREAMS,
     "IFOE_TX_SCHED_ACTIVE_TX_ACK_RES_STREAMS"},
    {IFOE_TELEM_ID_IFOE_TX_SCHED_ACTIVE_RX_ACK_PKTS, "IFOE_TX_SCHED_ACTIVE_RX_ACK_PKTS"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_0,
     "IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_1,
     "IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_2,
     "IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_3,
     "IFOE_RX_DECAP_PKT_XRSEC_INGRESS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_0,
     "IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_1,
     "IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_2,
     "IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_3,
     "IFOE_RX_DECAP_PKT_LEN_XRSEC_INGRESS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_0,
     "IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_1,
     "IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_2,
     "IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_3,
     "IFOE_RX_DECAP_PAYL_LEN_XRSEC_INGRESS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_VALID_INGRESS_XRSEC, "IFOE_RX_DECAP_VALID_INGRESS_XRSEC"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_STALL_INGRESS_XRSEC, "IFOE_RX_DECAP_STALL_INGRESS_XRSEC"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_EGRESS_REQ, "IFOE_RX_DECAP_PKT_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_PKT_EGRESS_RSP, "IFOE_RX_DECAP_PKT_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_VALID_EGRESS, "IFOE_RX_DECAP_VALID_EGRESS"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_CRDT_EGRESS_REQ, "IFOE_RX_DECAP_CRDT_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_CRDT_EGRESS_RSP, "IFOE_RX_DECAP_CRDT_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_TX_ACK_EGRESS_REQ, "IFOE_RX_DECAP_TX_ACK_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_TX_ACK_EGRESS_RSP, "IFOE_RX_DECAP_TX_ACK_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_TX_NAK_EGRESS_REQ, "IFOE_RX_DECAP_TX_NAK_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_TX_NAK_EGRESS_RSP, "IFOE_RX_DECAP_TX_NAK_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_RX_ACK_EGRESS_REQ, "IFOE_RX_DECAP_RX_ACK_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_RX_ACK_EGRESS_RSP, "IFOE_RX_DECAP_RX_ACK_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_RX_NAK_EGRESS_REQ, "IFOE_RX_DECAP_RX_NAK_EGRESS_REQ"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_RX_NAK_EGRESS_RSP, "IFOE_RX_DECAP_RX_NAK_EGRESS_RSP"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_DROPPED_PKTS, "IFOE_RX_DECAP_DROPPED_PKTS"},
    {IFOE_TELEM_ID_IFOE_RX_DECAP_INIT_BUSY, "IFOE_RX_DECAP_INIT_BUSY"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_TOTAL_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_REQ_TOTAL_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_PAYLOAD_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_REQ_PAYLOAD_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_EXCESS_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_REQ_EXCESS_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RSP_TOTAL_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_RSP_TOTAL_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RSP_PAYLOAD_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_RSP_PAYLOAD_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RSP_EXCESS_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_RSP_EXCESS_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_REQ_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_REQ_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_ORIGDATA_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_ORIGDATA_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_ORIGDATA_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_ORIGDATA_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_WRRSP_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_WRRSP_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_WRRSP_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_WRRSP_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RDRSP_CREDITS_CONSUMED,
     "IFOE_SDP_RX_UNPACK_RDRSP_CREDITS_CONSUMED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RDRSP_CREDITS_RETURNED,
     "IFOE_SDP_RX_UNPACK_RDRSP_CREDITS_RETURNED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_CYCLES_STALLED, "IFOE_SDP_RX_UNPACK_REQ_CYCLES_STALLED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RSP_CYCLES_STALLED, "IFOE_SDP_RX_UNPACK_RSP_CYCLES_STALLED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_REQ_CYCLES_STALLED_CNT,
     "IFOE_SDP_RX_UNPACK_REQ_CYCLES_STALLED_CNT"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RSP_CYCLES_STALLED_CNT,
     "IFOE_SDP_RX_UNPACK_RSP_CYCLES_STALLED_CNT"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RETAG_USED, "IFOE_SDP_RX_UNPACK_RETAG_USED"},
    {IFOE_TELEM_ID_IFOE_SDP_RX_UNPACK_RETAG_FREED, "IFOE_SDP_RX_UNPACK_RETAG_FREED"},
    {IFOE_TELEM_ID_SWITCH_RX_NONIFOE_PKTS, "SWITCH_RX_NONIFOE_PKTS"},
    {IFOE_TELEM_ID_SWITCH_RX_NONIFOE_BYTES, "SWITCH_RX_NONIFOE_BYTES"},
    {IFOE_TELEM_ID_SWITCH_RX_DROPPED_PKTS, "SWITCH_RX_DROPPED_PKTS"},
    {IFOE_TELEM_ID_SWITCH_RX_DROPPED_BYTES, "SWITCH_RX_DROPPED_BYTES"},
    {IFOE_TELEM_ID_SWITCH_TX_NONIFOE_PKTS, "SWITCH_TX_NONIFOE_PKTS"},
    {IFOE_TELEM_ID_SWITCH_TX_NONIFOE_BYTES, "SWITCH_TX_NONIFOE_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_TX_CORE_INIT_DONE, "CRYPTO_TX_CORE_INIT_DONE"},
    {IFOE_TELEM_ID_CRYPTO_RX_CORE_INIT_DONE, "CRYPTO_RX_CORE_INIT_DONE"},
    {IFOE_TELEM_ID_CRYPTO_TX_INGRESS_TOTAL_BYTES, "CRYPTO_TX_INGRESS_TOTAL_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_TX_INGRESS_TOTAL_PKTS, "CRYPTO_TX_INGRESS_TOTAL_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_TX_EGRESS_TOTAL_BYTES, "CRYPTO_TX_EGRESS_TOTAL_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_TX_EGRESS_TOTAL_PKTS, "CRYPTO_TX_EGRESS_TOTAL_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_RX_INGRESS_TOTAL_BYTES, "CRYPTO_RX_INGRESS_TOTAL_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_RX_INGRESS_TOTAL_PKTS, "CRYPTO_RX_INGRESS_TOTAL_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_RX_EGRESS_TOTAL_BYTES, "CRYPTO_RX_EGRESS_TOTAL_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_RX_EGRESS_TOTAL_PKTS, "CRYPTO_RX_EGRESS_TOTAL_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_TX_TOTAL_ENCRYPTED_BYTES, "CRYPTO_TX_TOTAL_ENCRYPTED_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_TX_TOTAL_ENCRYPTED_PKTS, "CRYPTO_TX_TOTAL_ENCRYPTED_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_TX_TOTAL_ERROR_PKTS, "CRYPTO_TX_TOTAL_ERROR_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_RX_TOTAL_DECRYPTED_BYTES, "CRYPTO_RX_TOTAL_DECRYPTED_BYTES"},
    {IFOE_TELEM_ID_CRYPTO_RX_TOTAL_DECRYPTED_PKTS, "CRYPTO_RX_TOTAL_DECRYPTED_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_RX_TOTAL_BAD_PKTS, "CRYPTO_RX_TOTAL_BAD_PKTS"},
    {IFOE_TELEM_ID_CRYPTO_RX_TOTAL_ERROR_PKTS, "CRYPTO_RX_TOTAL_ERROR_PKTS"},
    {IFOE_TELEM_ID_PFC_TX_PAUSE_PACKETS_SENT, "PFC_TX_PAUSE_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO0_PACKETS_SENT, "PFC_TX_PFC_PRIO0_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO1_PACKETS_SENT, "PFC_TX_PFC_PRIO1_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO2_PACKETS_SENT, "PFC_TX_PFC_PRIO2_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO3_PACKETS_SENT, "PFC_TX_PFC_PRIO3_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO4_PACKETS_SENT, "PFC_TX_PFC_PRIO4_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO5_PACKETS_SENT, "PFC_TX_PFC_PRIO5_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO6_PACKETS_SENT, "PFC_TX_PFC_PRIO6_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_TX_PFC_PRIO7_PACKETS_SENT, "PFC_TX_PFC_PRIO7_PACKETS_SENT"},
    {IFOE_TELEM_ID_PFC_RX_PAUSE_PACKETS_RCVD, "PFC_RX_PAUSE_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO0_PACKETS_RCVD, "PFC_RX_PFC_PRIO0_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO1_PACKETS_RCVD, "PFC_RX_PFC_PRIO1_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO2_PACKETS_RCVD, "PFC_RX_PFC_PRIO2_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO3_PACKETS_RCVD, "PFC_RX_PFC_PRIO3_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO4_PACKETS_RCVD, "PFC_RX_PFC_PRIO4_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO5_PACKETS_RCVD, "PFC_RX_PFC_PRIO5_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO6_PACKETS_RCVD, "PFC_RX_PFC_PRIO6_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_RX_PFC_PRIO7_PACKETS_RCVD, "PFC_RX_PFC_PRIO7_PACKETS_RCVD"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_TOTAL_BYTES, "PFC_REQ_Q_TX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_TOTAL_PACKETS, "PFC_REQ_Q_TX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_XOFF_TOTAL, "PFC_REQ_Q_TX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_DELAY_TOTAL, "PFC_REQ_Q_TX_DELAY_TOTAL"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_FLV, "PFC_REQ_Q_TX_FLV"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_XOFF_PERIOD, "PFC_REQ_Q_TX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_UNF, "PFC_REQ_Q_TX_UNF"},
    {IFOE_TELEM_ID_PFC_REQ_Q_TX_QUEUE_EMPTY, "PFC_REQ_Q_TX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_TOTAL_BYTES, "PFC_RES_Q_TX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_TOTAL_PACKETS, "PFC_RES_Q_TX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_XOFF_TOTAL, "PFC_RES_Q_TX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_DELAY_TOTAL, "PFC_RES_Q_TX_DELAY_TOTAL"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_FLV, "PFC_RES_Q_TX_FLV"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_XOFF_PERIOD, "PFC_RES_Q_TX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_UNF, "PFC_RES_Q_TX_UNF"},
    {IFOE_TELEM_ID_PFC_RES_Q_TX_QUEUE_EMPTY, "PFC_RES_Q_TX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_TOTAL_BYTES, "PFC_NONIFOE_Q_TX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_TOTAL_PACKETS, "PFC_NONIFOE_Q_TX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_XOFF_TOTAL, "PFC_NONIFOE_Q_TX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_DELAY_TOTAL, "PFC_NONIFOE_Q_TX_DELAY_TOTAL"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_FLV, "PFC_NONIFOE_Q_TX_FLV"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_XOFF_PERIOD, "PFC_NONIFOE_Q_TX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_UNF, "PFC_NONIFOE_Q_TX_UNF"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_TX_QUEUE_EMPTY, "PFC_NONIFOE_Q_TX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_TOTAL_BYTES, "PFC_REQ_Q_RX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_DROPPED_BYTES, "PFC_REQ_Q_RX_DROPPED_BYTES"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_TOTAL_PACKETS, "PFC_REQ_Q_RX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_DROPPED_PACKETS, "PFC_REQ_Q_RX_DROPPED_PACKETS"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_TRUNCATED_PACKETS, "PFC_REQ_Q_RX_TRUNCATED_PACKETS"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_XOFF_TOTAL, "PFC_REQ_Q_RX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_FLV, "PFC_REQ_Q_RX_FLV"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_UTF, "PFC_REQ_Q_RX_UTF"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_XOFF_PERIOD, "PFC_REQ_Q_RX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_CREDIT_INT, "PFC_REQ_Q_RX_CREDIT_INT"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_CREDIT_ERR, "PFC_REQ_Q_RX_CREDIT_ERR"},
    {IFOE_TELEM_ID_PFC_REQ_Q_RX_QUEUE_EMPTY, "PFC_REQ_Q_RX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_TOTAL_BYTES, "PFC_RES_Q_RX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_DROPPED_BYTES, "PFC_RES_Q_RX_DROPPED_BYTES"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_TOTAL_PACKETS, "PFC_RES_Q_RX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_DROPPED_PACKETS, "PFC_RES_Q_RX_DROPPED_PACKETS"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_TRUNCATED_PACKETS, "PFC_RES_Q_RX_TRUNCATED_PACKETS"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_XOFF_TOTAL, "PFC_RES_Q_RX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_FLV, "PFC_RES_Q_RX_FLV"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_UTF, "PFC_RES_Q_RX_UTF"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_XOFF_PERIOD, "PFC_RES_Q_RX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_CREDIT_INT, "PFC_RES_Q_RX_CREDIT_INT"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_CREDIT_ERR, "PFC_RES_Q_RX_CREDIT_ERR"},
    {IFOE_TELEM_ID_PFC_RES_Q_RX_QUEUE_EMPTY, "PFC_RES_Q_RX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_TOTAL_BYTES, "PFC_NONIFOE_Q_RX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_DROPPED_BYTES, "PFC_NONIFOE_Q_RX_DROPPED_BYTES"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_TOTAL_PACKETS, "PFC_NONIFOE_Q_RX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_DROPPED_PACKETS, "PFC_NONIFOE_Q_RX_DROPPED_PACKETS"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_TRUNCATED_PACKETS, "PFC_NONIFOE_Q_RX_TRUNCATED_PACKETS"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_XOFF_TOTAL, "PFC_NONIFOE_Q_RX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_FLV, "PFC_NONIFOE_Q_RX_FLV"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_UTF, "PFC_NONIFOE_Q_RX_UTF"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_XOFF_PERIOD, "PFC_NONIFOE_Q_RX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_CREDIT_INT, "PFC_NONIFOE_Q_RX_CREDIT_INT"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_CREDIT_ERR, "PFC_NONIFOE_Q_RX_CREDIT_ERR"},
    {IFOE_TELEM_ID_PFC_NONIFOE_Q_RX_QUEUE_EMPTY, "PFC_NONIFOE_Q_RX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_TOTAL_BYTES, "PFC_DISCARD_Q_RX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_DROPPED_BYTES, "PFC_DISCARD_Q_RX_DROPPED_BYTES"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_TOTAL_PACKETS, "PFC_DISCARD_Q_RX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_DROPPED_PACKETS, "PFC_DISCARD_Q_RX_DROPPED_PACKETS"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_TRUNCATED_PACKETS, "PFC_DISCARD_Q_RX_TRUNCATED_PACKETS"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_XOFF_TOTAL, "PFC_DISCARD_Q_RX_XOFF_TOTAL"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_FLV, "PFC_DISCARD_Q_RX_FLV"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_UTF, "PFC_DISCARD_Q_RX_UTF"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_XOFF_PERIOD, "PFC_DISCARD_Q_RX_XOFF_PERIOD"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_CREDIT_INT, "PFC_DISCARD_Q_RX_CREDIT_INT"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_CREDIT_ERR, "PFC_DISCARD_Q_RX_CREDIT_ERR"},
    {IFOE_TELEM_ID_PFC_DISCARD_Q_RX_QUEUE_EMPTY, "PFC_DISCARD_Q_RX_QUEUE_EMPTY"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_BYTES, "NETPORT_TX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_GOOD_BYTES, "NETPORT_TX_TOTAL_GOOD_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_ERR_BYTES, "NETPORT_TX_TOTAL_ERR_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_PACKETS, "NETPORT_TX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_GOOD_PACKETS, "NETPORT_TX_TOTAL_GOOD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_TX_FRAME_ERROR, "NETPORT_TX_FRAME_ERROR"},
    {IFOE_TELEM_ID_NETPORT_TX_BAD_FCS, "NETPORT_TX_BAD_FCS"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_64_BYTES, "NETPORT_TX_PACKET_64_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_65_127_BYTES, "NETPORT_TX_PACKET_65_127_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_128_255_BYTES, "NETPORT_TX_PACKET_128_255_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_256_511_BYTES, "NETPORT_TX_PACKET_256_511_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_512_1023_BYTES, "NETPORT_TX_PACKET_512_1023_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_1024_1518_BYTES, "NETPORT_TX_PACKET_1024_1518_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_1519_1522_BYTES, "NETPORT_TX_PACKET_1519_1522_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_1523_1548_BYTES, "NETPORT_TX_PACKET_1523_1548_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_1549_2047_BYTES, "NETPORT_TX_PACKET_1549_2047_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_2048_4095_BYTES, "NETPORT_TX_PACKET_2048_4095_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_4096_8191_BYTES, "NETPORT_TX_PACKET_4096_8191_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_8192_9215_BYTES, "NETPORT_TX_PACKET_8192_9215_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_PACKET_LARGE, "NETPORT_TX_PACKET_LARGE"},
    {IFOE_TELEM_ID_NETPORT_TX_UNICAST, "NETPORT_TX_UNICAST"},
    {IFOE_TELEM_ID_NETPORT_TX_MULTICAST, "NETPORT_TX_MULTICAST"},
    {IFOE_TELEM_ID_NETPORT_TX_BROADCAST, "NETPORT_TX_BROADCAST"},
    {IFOE_TELEM_ID_NETPORT_TX_VLAN, "NETPORT_TX_VLAN"},
    {IFOE_TELEM_ID_NETPORT_TX_PAUSE, "NETPORT_TX_PAUSE"},
    {IFOE_TELEM_ID_NETPORT_TX_USER_PAUSE, "NETPORT_TX_USER_PAUSE"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_PAD_BYTES, "NETPORT_TX_TOTAL_PAD_BYTES"},
    {IFOE_TELEM_ID_NETPORT_TX_TOTAL_PAD_PACKETS, "NETPORT_TX_TOTAL_PAD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_TOTAL_BYTES, "NETPORT_RX_TOTAL_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_TOTAL_GOOD_BYTES, "NETPORT_RX_TOTAL_GOOD_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_TOTAL_ERR_BYTES, "NETPORT_RX_TOTAL_ERR_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_TOTAL_PACKETS, "NETPORT_RX_TOTAL_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_TOTAL_GOOD_PACKETS, "NETPORT_RX_TOTAL_GOOD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_SMALL, "NETPORT_RX_PACKET_SMALL"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_DROPPED, "NETPORT_RX_PACKET_DROPPED"},
    {IFOE_TELEM_ID_NETPORT_RX_BAD_CODE_COUNT, "NETPORT_RX_BAD_CODE_COUNT"},
    {IFOE_TELEM_ID_NETPORT_RX_BAD_FCS, "NETPORT_RX_BAD_FCS"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_BAD_FCS, "NETPORT_RX_PACKET_BAD_FCS"},
    {IFOE_TELEM_ID_NETPORT_RX_STOMPED_FCS, "NETPORT_RX_STOMPED_FCS"},
    {IFOE_TELEM_ID_NETPORT_RX_TRUNCATED, "NETPORT_RX_TRUNCATED"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_64_BYTES, "NETPORT_RX_PACKET_64_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_65_127_BYTES, "NETPORT_RX_PACKET_65_127_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_128_255_BYTES, "NETPORT_RX_PACKET_128_255_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_256_511_BYTES, "NETPORT_RX_PACKET_256_511_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_512_1023_BYTES, "NETPORT_RX_PACKET_512_1023_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_1024_1518_BYTES, "NETPORT_RX_PACKET_1024_1518_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_1519_1522_BYTES, "NETPORT_RX_PACKET_1519_1522_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_1523_1548_BYTES, "NETPORT_RX_PACKET_1523_1548_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_1549_2047_BYTES, "NETPORT_RX_PACKET_1549_2047_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_2048_4095_BYTES, "NETPORT_RX_PACKET_2048_4095_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_4096_8191_BYTES, "NETPORT_RX_PACKET_4096_8191_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_8192_9215_BYTES, "NETPORT_RX_PACKET_8192_9215_BYTES"},
    {IFOE_TELEM_ID_NETPORT_RX_TOOLONG, "NETPORT_RX_TOOLONG"},
    {IFOE_TELEM_ID_NETPORT_RX_PACKET_LARGE, "NETPORT_RX_PACKET_LARGE"},
    {IFOE_TELEM_ID_NETPORT_RX_JABBER, "NETPORT_RX_JABBER"},
    {IFOE_TELEM_ID_NETPORT_RX_OVERSIZE, "NETPORT_RX_OVERSIZE"},
    {IFOE_TELEM_ID_NETPORT_RX_UNICAST, "NETPORT_RX_UNICAST"},
    {IFOE_TELEM_ID_NETPORT_RX_MULTICAST, "NETPORT_RX_MULTICAST"},
    {IFOE_TELEM_ID_NETPORT_RX_BROADCAST, "NETPORT_RX_BROADCAST"},
    {IFOE_TELEM_ID_NETPORT_RX_VLAN, "NETPORT_RX_VLAN"},
    {IFOE_TELEM_ID_NETPORT_RX_PAUSE, "NETPORT_RX_PAUSE"},
    {IFOE_TELEM_ID_NETPORT_RX_USER_PAUSE, "NETPORT_RX_USER_PAUSE"},
    {IFOE_TELEM_ID_NETPORT_RX_INRANGEERR, "NETPORT_RX_INRANGEERR"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_CW, "NETPORT_RX_FEC_CW"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_CORRECTED_CW, "NETPORT_RX_FEC_CORRECTED_CW"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_UNCORRECTED_CW, "NETPORT_RX_FEC_UNCORRECTED_CW"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_CWB, "NETPORT_RX_FEC_CWB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_CORRECTED_CWB, "NETPORT_RX_FEC_CORRECTED_CWB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_UNCORRECTED_CWB, "NETPORT_RX_FEC_UNCORRECTED_CWB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_0TO1_L0, "NETPORT_RX_FEC_BIT_ERR_0TO1_L0"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_0TO1_L1, "NETPORT_RX_FEC_BIT_ERR_0TO1_L1"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_0TO1_L2, "NETPORT_RX_FEC_BIT_ERR_0TO1_L2"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_0TO1_L3, "NETPORT_RX_FEC_BIT_ERR_0TO1_L3"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_1TO0_L0_LSB, "NETPORT_RX_FEC_BIT_ERR_1TO0_L0_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_1TO0_L1_LSB, "NETPORT_RX_FEC_BIT_ERR_1TO0_L1_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_1TO0_L2_LSB, "NETPORT_RX_FEC_BIT_ERR_1TO0_L2_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_BIT_ERR_1TO0_L3_LSB, "NETPORT_RX_FEC_BIT_ERR_1TO0_L3_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_ERR_COUNT_L0_LSB, "NETPORT_RX_FEC_ERR_COUNT_L0_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_ERR_COUNT_L1_LSB, "NETPORT_RX_FEC_ERR_COUNT_L1_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_ERR_COUNT_L2_LSB, "NETPORT_RX_FEC_ERR_COUNT_L2_LSB"},
    {IFOE_TELEM_ID_NETPORT_RX_FEC_ERR_COUNT_L3_LSB, "NETPORT_RX_FEC_ERR_COUNT_L3_LSB"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_ACKED_SEQ, "NETPORT_TX_LLR_ACKED_SEQ"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_DATA_AGE_TIMER, "NETPORT_TX_LLR_DATA_AGE_TIMER"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_OUTSTANDING_DATA, "NETPORT_TX_LLR_OUTSTANDING_DATA"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_OUTSTANDING_SEQ, "NETPORT_TX_LLR_OUTSTANDING_SEQ"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_PCS_LOST_STATUS_TIMER, "NETPORT_TX_LLR_PCS_LOST_STATUS_TIMER"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_REPLAY_CT, "NETPORT_TX_LLR_REPLAY_CT"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_REPLAY_TIMER, "NETPORT_TX_LLR_REPLAY_TIMER"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_TX_SEQ, "NETPORT_TX_LLR_TX_SEQ"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_RTT_ESTIMATE, "NETPORT_TX_LLR_RTT_ESTIMATE"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_ACK_CTLOS, "NETPORT_TX_LLR_ACK_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_NACK_CTLOS, "NETPORT_TX_LLR_NACK_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_INIT_CTLOS, "NETPORT_TX_LLR_INIT_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_INIT_ECHO_CTLOS, "NETPORT_TX_LLR_INIT_ECHO_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_RCVD_ACK_NACK_SEQ_ERROR,
     "NETPORT_TX_LLR_RCVD_ACK_NACK_SEQ_ERROR"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_REPLAYS_COMPLETED, "NETPORT_TX_LLR_REPLAYS_COMPLETED"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_FLUSH_DISCARDED_PACKETS,
     "NETPORT_TX_LLR_FLUSH_DISCARDED_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_INIT_DISCARDED_PACKETS, "NETPORT_TX_LLR_INIT_DISCARDED_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_OK_PACKETS, "NETPORT_TX_LLR_OK_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_TX_LLR_POISONED_PACKETS, "NETPORT_TX_LLR_POISONED_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_NEXT_RX_SEQ, "NETPORT_RX_LLR_NEXT_RX_SEQ"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_ACK_CTLOS, "NETPORT_RX_LLR_ACK_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_NACK_CTLOS, "NETPORT_RX_LLR_NACK_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_INIT_CTLOS, "NETPORT_RX_LLR_INIT_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_INIT_ECHO_CTLOS, "NETPORT_RX_LLR_INIT_ECHO_CTLOS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_REPLAYS_DETECTED, "NETPORT_RX_LLR_REPLAYS_DETECTED"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_BAD_PACKETS, "NETPORT_RX_LLR_BAD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_DUPL_SEQ_PACKETS, "NETPORT_RX_LLR_DUPL_SEQ_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_EXP_SEQ_BAD_PACKETS, "NETPORT_RX_LLR_EXP_SEQ_BAD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_EXP_SEQ_GOOD_PACKETS, "NETPORT_RX_LLR_EXP_SEQ_GOOD_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_EXP_SEQ_POISONED_PACKETS,
     "NETPORT_RX_LLR_EXP_SEQ_POISONED_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_MISS_SEQ_PACKETS, "NETPORT_RX_LLR_MISS_SEQ_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_OK_PACKETS, "NETPORT_RX_LLR_OK_PACKETS"},
    {IFOE_TELEM_ID_NETPORT_RX_LLR_POISONED_PACKETS, "NETPORT_RX_LLR_POISONED_PACKETS"},
    {IFOE_TELEM_ID_IFOE_LOGICAL_LINK_STATUS, "IFOE_LOGICAL_LINK_STATUS"},
    {IFOE_TELEM_ID_IFOE_LOGICAL_LINK_BW, "IFOE_LOGICAL_LINK_BW"},
    {IFOE_TELEM_ID_IFOE_TX_REQUEST_PKT_COUNT, "IFOE_TX_REQUEST_PKT_COUNT"},
    {IFOE_TELEM_ID_IFOE_TX_RESPONSE_PKT_COUNT, "IFOE_TX_RESPONSE_PKT_COUNT"},
    {IFOE_TELEM_ID_IFOE_RX_REQUEST_PKT_COUNT, "IFOE_RX_REQUEST_PKT_COUNT"},
    {IFOE_TELEM_ID_IFOE_RX_RESPONSE_PKT_COUNT, "IFOE_RX_RESPONSE_PKT_COUNT"},
    {IFOE_TELEM_ID_IFOE_STREAM_REMAPS_TOTAL, "IFOE_STREAM_REMAPS_TOTAL"},
    {IFOE_TELEM_ID_IFOE_STREAM_REMAPS_NPORT_0, "IFOE_STREAM_REMAPS_NPORT_0"},
    {IFOE_TELEM_ID_IFOE_STREAM_REMAPS_NPORT_1, "IFOE_STREAM_REMAPS_NPORT_1"},
    {IFOE_TELEM_ID_IFOE_STREAM_REMAPS_NPORT_2, "IFOE_STREAM_REMAPS_NPORT_2"},
    {IFOE_TELEM_ID_IFOE_STREAM_REMAPS_NPORT_3, "IFOE_STREAM_REMAPS_NPORT_3"},
    {IFOE_TELEM_ID_IFOE_PAUSED_STREAMS_COUNT, "IFOE_PAUSED_STREAMS_COUNT"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_TX_KEY_UPDATES_SA0, "IFOE_CRYPTO_TX_KEY_UPDATES_SA0"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY0_UPDATES_SA0, "IFOE_CRYPTO_RX_KEY0_UPDATES_SA0"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY1_UPDATES_SA0, "IFOE_CRYPTO_RX_KEY1_UPDATES_SA0"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY_DISABLES_SA0, "IFOE_CRYPTO_RX_KEY_DISABLES_SA0"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_TX_KEY_UPDATES_SA1, "IFOE_CRYPTO_TX_KEY_UPDATES_SA1"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY0_UPDATES_SA1, "IFOE_CRYPTO_RX_KEY0_UPDATES_SA1"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY1_UPDATES_SA1, "IFOE_CRYPTO_RX_KEY1_UPDATES_SA1"},
    {IFOE_TELEM_ID_IFOE_CRYPTO_RX_KEY_DISABLES_SA1, "IFOE_CRYPTO_RX_KEY_DISABLES_SA1"},
    {IFOE_TELEM_ID_NETPORT_LINK_STATUS, "NETPORT_LINK_STATUS"},
    {IFOE_TELEM_ID_NETPORT_LINK_SPEED, "NETPORT_LINK_SPEED"},
    {IFOE_TELEM_ID_NETPORT_BIT_ERROR_RATE, "NETPORT_BIT_ERROR_RATE"},
    {IFOE_TELEM_ID_NETPORT_LAST_LINK_TRAINING_DURATION, "NETPORT_LAST_LINK_TRAINING_DURATION"},
    {IFOE_TELEM_ID_NETPORT_AVERAGE_LINK_TRAINING_TIME, "NETPORT_AVERAGE_LINK_TRAINING_TIME"},
    {IFOE_TELEM_ID_NETPORT_LINK_UP_COUNT, "NETPORT_LINK_UP_COUNT"},
    {IFOE_TELEM_ID_NETPORT_LINK_UP_TIME, "NETPORT_LINK_UP_TIME"},
    {IFOE_TELEM_ID_NETPORT_LINK_DOWN_TIME, "NETPORT_LINK_DOWN_TIME"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_0, "NETPORT_FEC_CW_SYMBOL_ERRS_0"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_1, "NETPORT_FEC_CW_SYMBOL_ERRS_1"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_2, "NETPORT_FEC_CW_SYMBOL_ERRS_2"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_3, "NETPORT_FEC_CW_SYMBOL_ERRS_3"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_4, "NETPORT_FEC_CW_SYMBOL_ERRS_4"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_5, "NETPORT_FEC_CW_SYMBOL_ERRS_5"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_6, "NETPORT_FEC_CW_SYMBOL_ERRS_6"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_7, "NETPORT_FEC_CW_SYMBOL_ERRS_7"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_8, "NETPORT_FEC_CW_SYMBOL_ERRS_8"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_9, "NETPORT_FEC_CW_SYMBOL_ERRS_9"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_10, "NETPORT_FEC_CW_SYMBOL_ERRS_10"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_11, "NETPORT_FEC_CW_SYMBOL_ERRS_11"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_12, "NETPORT_FEC_CW_SYMBOL_ERRS_12"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_13, "NETPORT_FEC_CW_SYMBOL_ERRS_13"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_14, "NETPORT_FEC_CW_SYMBOL_ERRS_14"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_15, "NETPORT_FEC_CW_SYMBOL_ERRS_15"},
    {IFOE_TELEM_ID_NETPORT_FEC_CW_SYMBOL_ERRS_UNCORRECTABLE,
     "NETPORT_FEC_CW_SYMBOL_ERRS_UNCORRECTABLE"},
};

amdsmi_status_t amdsmi_fabric_telem_id_to_string(uint64_t telem_id, const char** telem_name) {
  if (telem_name == nullptr) {
    return AMDSMI_STATUS_INVAL;
  }
  auto it = telemetry_id_map.find(telem_id);
  if (it != telemetry_id_map.end()) {
    *telem_name = it->second;
    return AMDSMI_STATUS_SUCCESS;
  }
  *telem_name = "UNKNOWN";
  return AMDSMI_STATUS_NOT_FOUND;
}

// Note: AMDSMI and UALoE telemetry structures are now designed to be binary compatible
// No conversion function needed - direct casting is used

// Convert AMDSMI status to match errno-style returns
static amdsmi_status_t convert_errno_to_amdsmi_status(int errno_val) {
  switch (errno_val) {
    case 0:
      return AMDSMI_STATUS_SUCCESS;
    case EINVAL:
      return AMDSMI_STATUS_INVAL;
    case ENOTSUP:
      return AMDSMI_STATUS_NOT_SUPPORTED;
    case ENOMEM:
      return AMDSMI_STATUS_OUT_OF_RESOURCES;
    case EBUSY:
      return AMDSMI_STATUS_BUSY;
    case ENOENT:
      return AMDSMI_STATUS_NOT_FOUND;
    case ETIMEDOUT:
      return AMDSMI_STATUS_TIMEOUT;
    case EIO:
      return AMDSMI_STATUS_IO;
    case EPERM:
    case EACCES:
      return AMDSMI_STATUS_NO_PERM;
    default:
      return AMDSMI_STATUS_UNKNOWN_ERROR;
  }
}

amdsmi_status_t amdsmi_alloc_fabric_telemetry(amdsmi_processor_handle processor_handle,
                                              uint32_t category_mask,
                                              amdsmi_fabric_telemetry_t** telemetry) {
  if (!processor_handle || !telemetry) {
    return AMDSMI_STATUS_INVAL;
  }

  // Get AMDSmiGPUDevice from processor handle using helper function
  amd::smi::AMDSmiGPUDevice* device = nullptr;
  amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &device);
  if (r != AMDSMI_STATUS_SUCCESS) return r;

  // Acquire device mutex for UALoE API protection
  SMIGPUDEVICE_MUTEX(device->get_mutex());

  ualoe_handle_t ualoe_handle = device->get_ualoe_handle();

  // No UALoE session: fabric telemetry is unsupported on this device.
  if (ualoe_handle == -1) {
    return AMDSMI_STATUS_NOT_SUPPORTED;
  }

  uint32_t ualoe_category_mask = category_mask;

  // Allocate UALoE telemetry directly
  ualoe_telemetry_t* ualoe_tel = nullptr;
  int ret = ualoe_telemetry_alloc(ualoe_handle, ualoe_category_mask, &ualoe_tel);
  if (ret != 0) {
    return convert_errno_to_amdsmi_status(ret);
  }

  // Cast UALoE telemetry directly to AMDSMI telemetry since structures are now binary compatible
  *telemetry = reinterpret_cast<amdsmi_fabric_telemetry_t*>(ualoe_tel);

  return AMDSMI_STATUS_SUCCESS;
}

amdsmi_status_t amdsmi_get_fabric_telemetry_data(amdsmi_processor_handle processor_handle,
                                                 amdsmi_fabric_telemetry_t* telemetry) {
  if (!processor_handle || !telemetry) {
    return AMDSMI_STATUS_INVAL;
  }

  // Get AMDSmiGPUDevice from processor handle using helper function
  amd::smi::AMDSmiGPUDevice* device = nullptr;
  amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &device);
  if (r != AMDSMI_STATUS_SUCCESS) return r;

  // Acquire device mutex for UALoE API protection
  SMIGPUDEVICE_MUTEX(device->get_mutex());

  ualoe_handle_t ualoe_handle = device->get_ualoe_handle();

  // No UALoE session: fabric telemetry is unsupported on this device.
  if (ualoe_handle == -1) {
    return AMDSMI_STATUS_NOT_SUPPORTED;
  }

  // Cast AMDSMI telemetry directly to UALoE telemetry since structures are now binary compatible
  ualoe_telemetry_t* ualoe_tel = (ualoe_telemetry_t*)telemetry;

  // Get the latest telemetry data directly
  int ret = ualoe_telemetry_get(ualoe_handle, ualoe_tel);
  if (ret != 0) {
    return convert_errno_to_amdsmi_status(ret);
  }

  return AMDSMI_STATUS_SUCCESS;
}

amdsmi_status_t amdsmi_free_fabric_telemetry(amdsmi_processor_handle processor_handle,
                                             amdsmi_fabric_telemetry_t* telemetry) {
  if (!processor_handle || !telemetry) {
    return AMDSMI_STATUS_INVAL;
  }

  // Get AMDSmiGPUDevice from processor handle using helper function
  amd::smi::AMDSmiGPUDevice* device = nullptr;
  amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &device);
  if (r != AMDSMI_STATUS_SUCCESS) return r;

  // Acquire device mutex for UALoE API protection
  SMIGPUDEVICE_MUTEX(device->get_mutex());

  ualoe_handle_t ualoe_handle = device->get_ualoe_handle();

  // No UALoE session: fabric telemetry is unsupported on this device.
  if (ualoe_handle == -1) {
    return AMDSMI_STATUS_NOT_SUPPORTED;
  }

  // Cast AMDSMI telemetry directly to UALoE telemetry since structures are now binary compatible
  ualoe_telemetry_t* ualoe_tel = (ualoe_telemetry_t*)telemetry;

  // Free UALoE telemetry directly
  int ret = ualoe_telemetry_free(ualoe_handle, ualoe_tel);
  if (ret != 0) {
    return convert_errno_to_amdsmi_status(ret);
  }

  return AMDSMI_STATUS_SUCCESS;
}

amdsmi_status_t amdsmi_get_gpu_fabric_info(amdsmi_processor_handle processor_handle,
                                           amdsmi_fabric_info_t* info) {
  std::ostringstream outstream;
  outstream << __PRETTY_FUNCTION__ << " | ======= start =======";
  LOG_DEBUG(outstream);

  if (!processor_handle || !info) {
    return amdsmi_status_t::AMDSMI_STATUS_INVAL;
  }

  // Get AMDSmiGPUDevice from processor handle using helper function
  auto status_code(amdsmi_status_t::AMDSMI_STATUS_SUCCESS);

  amd::smi::AMDSmiGPUDevice* device = nullptr;
  if (auto api_status = get_gpu_device_from_handle(processor_handle, &device);
      (api_status != amdsmi_status_t::AMDSMI_STATUS_SUCCESS)) {
    outstream << __PRETTY_FUNCTION__ << " | get_gpu_device_from_handle() failed: " << api_status;
    LOG_DEBUG(outstream);
    return api_status;
  }

  outstream << __PRETTY_FUNCTION__ << " | get_gpu_device_from_handle(): " << device;
  LOG_DEBUG(outstream);

  // Serialize with other per-GPU UALoE/fabric paths; fabric info is 'sysfs-only'
  // and does not require a successful ualoe_open() netlink session (telemetry does)
  // ualoe_handle_t ualoe_handle = device->get_ualoe_handle();
  SMIGPUDEVICE_MUTEX(device->get_mutex());
  status_code = device->get_fabric_info_from_ualoe(*info);

  return status_code;
}
