[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-428]Slot Indication at DUAPP
[o-du/l2.git] / src / 5gnrrlc / rlc_msg_hdl.c
index 9b33b26..9fbb0d7 100644 (file)
 #include "lkw.h"           /* LKW defines */
 #include "ckw.h"           /* CKW defines */
 #include "kwu.h"           /* KWU defines */
-#include "kw_env.h"        /* RLC environment options */
-#include "kw.h"            /* RLC defines */
-#include "kw_udx.h"
-#include "kw_ul.h"
-#include "kw_dl.h"
+#include "rlc_env.h"        /* RLC environment options */
+#include "rlc_err.h"
+
 
 /* header/extern include files (.x) */
 #include "rgu.x"           
 #include "lkw.x"           /* LKW */
 #include "ckw.x"           /* CKW */
 #include "kwu.x"           /* KWU */
-#include "kw_err.h"
-#include "kw.x"
-#include "kw_udx.x"
-#include "kw_dl.x"
-#include "kw_ul.x"
 
+#include "rlc_utils.h"            /* RLC defines */
+#include "rlc_dl_ul_inf.h"
+#include "rlc_dl.h"
+#include "rlc_ul.h"
 #include "rlc_mac_inf.h"
 #include "du_app_rlc_inf.h"
-#include "rlc_utils.h"
 #include "rlc_upr_inf_api.h"
+#include "rlc_mgr.h"
 /*******************************************************************
  *
  * @brief Fills RLC UL UE Cfg Rsp from RlcCRsp 
  *
  * @details
  *
- *    Function : fillRlcUlUeCfgRsp
+ *    Function : fillRlcUeCfgRsp
  *
  *    Functionality: 
  *     Fills RLC UL UE Cfg Rsp from RlcCRsp
  *  @params[in]  Pointer to RlcCfgCfm
  *               Pointer to RlcUeCfgRsp
  *
- *  @return void
+ *  @return ROK/RFAILED
  * 
  *****************************************************************/
 
-void fillRlcUlUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp)
+uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp)
 {
    uint8_t idx;
+   uint8_t ret = ROK;
  
    rlcCfgRsp->cellId = rlcCRsp->cellId;
-   rlcCfgRsp->ueIdx  = rlcCRsp->ueId;
+   rlcCfgRsp->ueId   = rlcCRsp->ueId;
    for(idx = 0; idx < rlcCRsp->numEnt; idx++)
    {
       if(rlcCRsp->entCfgCfm[idx].status.status == CKW_CFG_CFM_OK)
       {
          rlcCfgRsp->result = RLC_DU_APP_RSP_OK;
         rlcCfgRsp->reason = rlcCRsp->entCfgCfm[idx].status.reason;
+        ret = ROK;
       }
       else
       {
          rlcCfgRsp->result = RLC_DU_APP_RSP_NOK;
         rlcCfgRsp->reason = rlcCRsp->entCfgCfm[idx].status.reason;
+        ret = RFAILED;
+        break;
       }
    }
+   return ret;
 }
 
 /*******************************************************************
@@ -104,33 +106,180 @@ void fillEntModeAndDir(uint8_t *entMode, uint8_t *direction, RlcMode rlcMode)
    switch(rlcMode)
    {
       case RLC_AM:
-         *entMode   = CM_LTE_MODE_AM;
+         *entMode   = RLC_MODE_AM;
          *direction = RLC_CFG_DIR_BOTH;
          break;
       case RLC_UM_BI_DIRECTIONAL:
-         *entMode = CM_LTE_MODE_UM;
+         *entMode = RLC_MODE_UM;
          *direction = RLC_CFG_DIR_BOTH;
          break;
       case RLC_UM_UNI_DIRECTIONAL_UL:
-         *entMode = CM_LTE_MODE_UM;
+         *entMode = RLC_MODE_UM;
          *direction = RLC_CFG_DIR_UL;
          break;
       case RLC_UM_UNI_DIRECTIONAL_DL:
-         *entMode = CM_LTE_MODE_UM;
+         *entMode = RLC_MODE_UM;
          *direction = RLC_CFG_DIR_DL;
          break;
       default : 
-         DU_LOG("\nRLC: Rlc Mode invalid %d", rlcMode);
+         DU_LOG("\nERROR  -->  RLC: Rlc Mode invalid %d", rlcMode);
     break;
    }
 }
+
+/*******************************************************************
+ *
+ * @brief fills LC Cfgs to be Added in RLC
+ *
+ * @details
+ *
+ *    Function : fillLcCfg
+ *
+ *    Functionality:
+ *      fills LC Cfgs to be Added in RLC
+ *
+ * @params[in] 
+ *             RlcEntCfgInfo pointer
+ *             RlcBearerCfg pointer
+ *             Config Type 
+ * @return ROK -  SUCCESS
+ *         RFAILED - FAILURE
+ *
+ * ****************************************************************/
+uint8_t fillLcCfg(RlcCb *gCb, RlcEntCfgInfo *rlcUeCfg, RlcBearerCfg *duRlcUeCfg)
+{
+   uint8_t lChRbIdx = 0;
+
+   rlcUeCfg->rbId                  = duRlcUeCfg->rbId;
+   rlcUeCfg->rbType                = duRlcUeCfg->rbType;   // SRB or DRB
+   rlcUeCfg->lCh[lChRbIdx].lChId   = duRlcUeCfg->lcId;   
+   rlcUeCfg->lCh[lChRbIdx].type    = duRlcUeCfg->lcType;
+   if(duRlcUeCfg->snssai)
+   {
+      RLC_ALLOC(gCb, rlcUeCfg->snssai, sizeof(Snssai));
+      if(rlcUeCfg->snssai == NULLP)
+      {
+         DU_LOG("\nERROR  --> RLC : fillLcCfg(): Failed to allocate memory for snssai");
+         return RFAILED;
+      }
+      memcpy(rlcUeCfg->snssai, duRlcUeCfg->snssai, sizeof(Snssai));
+   }
+   fillEntModeAndDir(&rlcUeCfg->entMode, &rlcUeCfg->dir, duRlcUeCfg->rlcMode);
+   rlcUeCfg->cfgType               = duRlcUeCfg->configType;
+   switch(rlcUeCfg->entMode)
+   {
+
+      case RLC_MODE_AM:
+         {
+            /* DL AM INFO */
+            rlcUeCfg->m.amInfo.dl.snLen       = duRlcUeCfg->u.amCfg->dlAmCfg.snLenDl; 
+            rlcUeCfg->m.amInfo.dl.pollRetxTmr = duRlcUeCfg->u.amCfg->dlAmCfg.pollRetxTmr;
+            rlcUeCfg->m.amInfo.dl.pollPdu     = duRlcUeCfg->u.amCfg->dlAmCfg.pollPdu; 
+            rlcUeCfg->m.amInfo.dl.pollByte    = duRlcUeCfg->u.amCfg->dlAmCfg.pollByte; 
+            rlcUeCfg->m.amInfo.dl.maxRetx     = duRlcUeCfg->u.amCfg->dlAmCfg.maxRetxTh;
+
+            /* UL AM INFO */
+            lChRbIdx++;   //lChRbIdx = 1, indicates UL AM
+            rlcUeCfg->lCh[lChRbIdx].lChId    = duRlcUeCfg->lcId;   
+            rlcUeCfg->lCh[lChRbIdx].type     = duRlcUeCfg->lcType;
+            rlcUeCfg->m.amInfo.ul.snLen      = duRlcUeCfg->u.amCfg->ulAmCfg.snLenUl; 
+            rlcUeCfg->m.amInfo.ul.staProhTmr = duRlcUeCfg->u.amCfg->ulAmCfg.statProhTmr;
+            rlcUeCfg->m.amInfo.ul.reAsmblTmr   = duRlcUeCfg->u.amCfg->ulAmCfg.reAssemTmr;
+            break;
+         }
+      case RLC_MODE_UM:
+         {
+            /* UL UM CONFIG */
+            rlcUeCfg->m.umInfo.ul.snLen      = duRlcUeCfg->u.umBiDirCfg->ulUmCfg.snLenUlUm; 
+            rlcUeCfg->m.umInfo.ul.reAsmblTmr = duRlcUeCfg->u.umBiDirCfg->ulUmCfg.reAssemTmr;
+
+            /* DL UM CONFIG */
+            rlcUeCfg->m.umInfo.dl.snLen = duRlcUeCfg->u.umBiDirCfg->dlUmCfg.snLenDlUm; 
+            break;
+         }
+      default:
+         break;
+   }/* End of switch(entMode) */
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief fills LC Cfgs to be Added in RLC
+ *
+ * @details
+ *
+ *    Function : fillRlcCfg
+ *
+ *    Functionality:
+ *      fills LC Cfgs to be Add/Mod/Del in RLC
+ *
+ * @params[in] 
+ *             RlcEntCfgInfo pointer
+ *             RlcBearerCfg pointer
+ * @return ROK - Success
+ *          RFAILED - Failure
+ *
+ ******************************************************************/
+
+uint8_t fillRlcCfg(RlcCb *gCb, RlcCfgInfo *rlcUeCfg, RlcUeCfg *ueCfg)
+{
+   uint8_t lcIdx;
+   
+   rlcUeCfg->ueId    = ueCfg->ueId;
+   rlcUeCfg->cellId  = ueCfg->cellId;
+   rlcUeCfg->numEnt  = ueCfg->numLcs;
+   rlcUeCfg->transId = getTransId();
+
+   for(lcIdx = 0; lcIdx < rlcUeCfg->numEnt; lcIdx++)
+   {
+      if(fillLcCfg(gCb, &rlcUeCfg->entCfg[lcIdx], &ueCfg->rlcLcCfg[lcIdx]) != ROK)
+      {
+          DU_LOG("\nERROR  --> RLC : fillRlcCfg(): Failed to fill LC configuration");
+          return RFAILED;
+      }
+   }
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Fill RlcCfgCfmInfo structure for sending failure response to DU
+ *
+ * @details
+ *
+ *    Function : fillRlcCfgFailureRsp
+ *
+ *    Functionality:
+ *      Fill RlcCfgCfmInfo structure for sending failure response to DU
+ *
+ * @params[in] RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg
+ *             
+ * @return void 
+ *
+ * ****************************************************************/
+void fillRlcCfgFailureRsp(RlcCfgCfmInfo *cfgRsp, RlcUeCfg *ueCfg)
+{
+   uint8_t cfgIdx =0;
+
+   cfgRsp->ueId = ueCfg->ueId;
+   cfgRsp->cellId = ueCfg->cellId;
+   cfgRsp->numEnt = ueCfg->numLcs;
+   for(cfgIdx =0; cfgIdx<ueCfg->numLcs; cfgIdx++)
+   {
+      cfgRsp->entCfgCfm[cfgIdx].rbId = ueCfg->rlcLcCfg[cfgIdx].rbId;
+      cfgRsp->entCfgCfm[cfgIdx].rbType = ueCfg->rlcLcCfg[cfgIdx].rbType;
+      cfgRsp->entCfgCfm[cfgIdx].status.status = RLC_DU_APP_RSP_NOK;
+      cfgRsp->entCfgCfm[cfgIdx].status.reason = CKW_CFG_REAS_NONE;
+   }
+}
 /*******************************************************************
  *
  * @brief Handles Ue Create Request from DU APP
  *
  * @details
  *
- *    Function : RlcUlProcUeCreateReq
+ *    Function : RlcProcUeCreateReq
  *
  *    Functionality:
  *      Handles Ue create Request from DU APP
@@ -141,80 +290,44 @@ void fillEntModeAndDir(uint8_t *entMode, uint8_t *direction, RlcMode rlcMode)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
+uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
 {
-   uint8_t idx;
    uint8_t ret = ROK;
-   uint8_t lChRbIdx;
+   RlcCb *gCb;
    RlcCfgInfo *rlcUeCfg = NULLP;
+   RlcCfgCfmInfo cfgRsp;
+   Pst rspPst;
 
-   RlcCb *rlcUeCb = NULLP;
-   rlcUeCb = RLC_GET_RLCCB(pst->dstInst);
-   RLC_ALLOC(rlcUeCb, rlcUeCfg, sizeof(RlcCfgInfo));
-   if(rlcUeCfg)
+   gCb = RLC_GET_RLCCB(pst->dstInst);
+   RLC_ALLOC(gCb, rlcUeCfg, sizeof(RlcCfgInfo));
+   if(rlcUeCfg == NULLP)
+   {
+      DU_LOG("\nERROR  -->  RLC: Failed to allocate memory at RlcProcUeCreateReq()");
+      ret = RFAILED;
+   }
+   else
    {
       memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
-
-      rlcUeCfg->ueId    = ueCfg->ueIdx;
-      rlcUeCfg->cellId  = ueCfg->cellId;
-      rlcUeCfg->numEnt  = ueCfg->numLcs;
-      rlcUeCfg->transId = getTransId();
-      for(idx = 0; idx < ueCfg->numLcs; idx++)
+      ret = fillRlcCfg(gCb, rlcUeCfg, ueCfg); 
+      if(ret != ROK)
       {
-         lChRbIdx = 0;
-         rlcUeCfg->entCfg[idx].rbId           = ueCfg->rlcBearerCfg[idx].rbId;
-         rlcUeCfg->entCfg[idx].rbType         = ueCfg->rlcBearerCfg[idx].rbType;   // SRB or DRB
-         rlcUeCfg->entCfg[idx].lCh[lChRbIdx].lChId   = ueCfg->rlcBearerCfg[idx].lcId;   
-         rlcUeCfg->entCfg[idx].lCh[lChRbIdx].type    = ueCfg->rlcBearerCfg[idx].lcType;
-         fillEntModeAndDir(&rlcUeCfg->entCfg[idx].entMode, &rlcUeCfg->entCfg[idx].dir,\
-            ueCfg->rlcBearerCfg[idx].rlcMode);
-         rlcUeCfg->entCfg[idx].cfgType        = CKW_CFG_ADD;
-         switch(rlcUeCfg->entCfg[idx].entMode)
-         {
-
-            case CM_LTE_MODE_AM:
-            {
-               /* DL AM INFO */
-               rlcUeCfg->entCfg[idx].m.amInfo.dl.snLen = ueCfg->rlcBearerCfg[idx].u.amCfg.dlAmCfg.snLenDl; 
-               rlcUeCfg->entCfg[idx].m.amInfo.dl.pollRetxTmr = ueCfg->rlcBearerCfg[idx].u.amCfg.dlAmCfg.pollRetxTmr;
-               rlcUeCfg->entCfg[idx].m.amInfo.dl.pollPdu = ueCfg->rlcBearerCfg[idx].u.amCfg.dlAmCfg.pollPdu; 
-               rlcUeCfg->entCfg[idx].m.amInfo.dl.pollByte = ueCfg->rlcBearerCfg[idx].u.amCfg.dlAmCfg.pollByte; 
-               rlcUeCfg->entCfg[idx].m.amInfo.dl.maxRetx = ueCfg->rlcBearerCfg[idx].u.amCfg.dlAmCfg.maxRetxTh;
-
-               /* UL AM INFO */
-              lChRbIdx++;   //lChRbIdx = 1, indicates UL AM
-               rlcUeCfg->entCfg[idx].lCh[lChRbIdx].lChId   = ueCfg->rlcBearerCfg[idx].lcId;   
-               rlcUeCfg->entCfg[idx].lCh[lChRbIdx].type    = ueCfg->rlcBearerCfg[idx].lcType;
-               rlcUeCfg->entCfg[idx].m.amInfo.ul.snLen = ueCfg->rlcBearerCfg[idx].u.amCfg.ulAmCfg.snLenUl; 
-               rlcUeCfg->entCfg[idx].m.amInfo.ul.staProhTmr = ueCfg->rlcBearerCfg[idx].u.amCfg.ulAmCfg.statProhTmr;
-               rlcUeCfg->entCfg[idx].m.amInfo.ul.reOrdTmr = ueCfg->rlcBearerCfg[idx].u.amCfg.ulAmCfg.reAssemTmr;
-               break;
-            }
-            case CM_LTE_MODE_UM:
-            {
-               /* UL UM CONFIG */
-               rlcUeCfg->entCfg[idx].m.umInfo.ul.snLen = ueCfg->rlcBearerCfg[idx].u.umBiDirCfg.ulUmCfg.snLenUlUm; 
-               rlcUeCfg->entCfg[idx].m.umInfo.ul.reOrdTmr = ueCfg->rlcBearerCfg[idx].u.umBiDirCfg.ulUmCfg.reAssemTmr;
+         DU_LOG("\nERROR  -->  RLC: Failed to fill configuration at RlcProcUeCreateReq()");
+         FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_CREATE_RSP);
+         fillRlcCfgFailureRsp(&cfgRsp, ueCfg);
+         SendRlcUeCfgRspToDu(&rspPst, &cfgRsp);
 
-               /* DL UM CONFIG */
-               rlcUeCfg->entCfg[idx].m.umInfo.dl.snLen = ueCfg->rlcBearerCfg[idx].u.umBiDirCfg.dlUmCfg.snLenDlUm; 
-               break;
-            }
-            default:
-               break;
-         }/* End of switch(entMode) */
-      }
-      ret = RlcProcCfgReq(pst, rlcUeCfg);
       }
       else
       {
-         DU_LOG("\nRLC: Failed to allocate memory ");
-         ret = RFAILED;
+         ret = RlcProcCfgReq(pst, rlcUeCfg);
+         if(ret != ROK)
+            DU_LOG("\nERROR  -->  RLC: Failed to configure Add/Mod/Del entities at RlcProcUeCreateReq()");
       }
-      RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));
-      return ret;
+   }
+   RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));
+   return ret;
 }
+
 /*******************************************************************
 *
 * @brief filling the structure of rrc delivery msg info
@@ -233,14 +346,14 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
 {
     Pst             pst;
     RrcDeliveryReport *rrcDelivery;
-    
-    DU_LOG("\nRLC : Filling the RRC Delivery Report");
+
+    DU_LOG("\nINFO  -->  RLC : Filling RRC Delivery Report");
     RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, rrcDelivery, sizeof(RrcDeliveryReport));
 
     if(rrcDelivery)
     {
        rrcDelivery->cellId = dlRrcMsgInfo->cellId;
-       rrcDelivery->ueIdx  = dlRrcMsgInfo->ueIdx;
+       rrcDelivery->ueId  = dlRrcMsgInfo->ueId;
        rrcDelivery->srbId  = dlRrcMsgInfo->lcId ;
        rrcDelivery->rrcDeliveryStatus.deliveryStatus    = PDCP_SN;
        rrcDelivery->rrcDeliveryStatus.triggeringMessage = PDCP_SN;
@@ -252,7 +365,7 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
     }
     else
     {
-       DU_LOG("\nRLC : Memory allocation failed");
+       DU_LOG("\nERROR  -->  RLC : Memory allocation failed");
     }
 
    return ROK;
@@ -276,12 +389,12 @@ uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
 {
    Buffer        *mBuf;
-   KwuDatReqInfo *datReqInfo;
+   RlcDatReqInfo *datReqInfo;
 
-   RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+   RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo));
    if(!datReqInfo)
    {
-      DU_LOG("\nRLC : Memory allocation failed in RlcProcDlRrcMsgTransfer");
+      DU_LOG("\nERROR  -->  RLC : Memory allocation failed in RlcProcDlRrcMsgTransfer");
       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
       return RFAILED;
@@ -289,7 +402,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
 
    datReqInfo->rlcId.rbType = dlRrcMsgInfo->rbType;
    datReqInfo->rlcId.rbId = dlRrcMsgInfo->rbId;
-   datReqInfo->rlcId.ueId = dlRrcMsgInfo->ueIdx;
+   datReqInfo->rlcId.ueId = dlRrcMsgInfo->ueId;
    datReqInfo->rlcId.cellId = dlRrcMsgInfo->cellId;
    datReqInfo->lcType = dlRrcMsgInfo->lcType;
    datReqInfo->sduId = ++(rlcCb[pst->dstInst]->dlSduId);
@@ -297,15 +410,18 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    /* Copy fixed buffer to message */
    if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &mBuf) != ROK)
    {
-      DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
-      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+      DU_LOG("\nERROR  -->  RLC : Memory allocation failed at RlcMacProcUlData");
+      RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo));
       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
       RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
       return RFAILED;
    }
    oduCpyFixBufToMsg(dlRrcMsgInfo->rrcMsg, mBuf, dlRrcMsgInfo->msgLen);
 
-   rlcProcDlData(pst, datReqInfo, mBuf);
+   if(rlcProcDlData(pst, datReqInfo, mBuf) != ROK)
+   {
+      return RFAILED;
+   }
 
    /* RRC Delivery report is only send when RRC Delivery status report is true in DL RRC Message */
    if(dlRrcMsgInfo->deliveryStaRpt)
@@ -314,7 +430,7 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    }
 
    /* Free memory allocated by du app */
-   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo));
    RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
    RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
    return ROK;
@@ -341,15 +457,16 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
 uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
 {
    uint8_t         ret = ROK;
-   uint8_t              idx, pduIdx;
-   uint8_t              lcId;                    /* Logical Channel */
-   uint8_t              numDLch = 0;             /* Number of dedicated logical channel */
+   uint8_t         idx, pduIdx;
+   uint8_t         lcId;                    /* Logical Channel */
+   uint8_t         numDLch = 0;             /* Number of dedicated logical channel */
    bool            dLchPduPres;             /* PDU received on dedicated logical channel */
-   RguLchDatInd    dLchData[MAX_NUM_LC];  /* PDU info on dedicated logical channel */
-   RguDDatIndInfo  *dLchUlDat;               /* UL data on dedicated logical channel */
-   RguCDatIndInfo  *cLchUlDat;               /* UL data on common logical channel */
+   RguLchDatInd    dLchData[MAX_NUM_LC];    /* PDU info on dedicated logical channel */
+   RguDDatIndInfo  *dLchUlDat;              /* UL data on dedicated logical channel */
+   RguCDatIndInfo  *cLchUlDat;              /* UL data on common logical channel */
 
    /* Initializing dedicated logical channel Database */
+   DU_LOG("\nDEBUG  -->  RLC: Received UL Data request from MAC");
    for(idx = 0; idx < MAX_NUM_LC; idx++)
    {
       dLchData[idx].lcId = idx;
@@ -364,30 +481,30 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
       if(ulData->pduInfo[idx].commCh)
       {
          RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \
-           sizeof(RguCDatIndInfo));
-        if(!cLchUlDat)
-        {
-           DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
-           ret = RFAILED;
-           break;
-        }
+               sizeof(RguCDatIndInfo));
+         if(!cLchUlDat)
+         {
+            DU_LOG("\nERROR  -->  RLC : Memory allocation failed at RlcProcUlData");
+            ret = RFAILED;
+            break;
+         }
          memset(cLchUlDat, 0, sizeof(RguCDatIndInfo));
 
          cLchUlDat->cellId = ulData->cellId;
-         GET_UE_IDX(ulData->rnti, cLchUlDat->rnti);
+         GET_UE_ID(ulData->rnti, cLchUlDat->rnti);
          cLchUlDat->lcId   = ulData->pduInfo[idx].lcId;
 
          /* Copy fixed buffer to message */
          if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &cLchUlDat->pdu) != ROK)
          {
-            DU_LOG("\nRLC : Memory allocation failed at RlcProcUlData");
-           RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \
-              sizeof(RguCDatIndInfo));
+            DU_LOG("\nERROR  -->  RLC : Memory allocation failed at RlcProcUlData");
+            RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, cLchUlDat, \
+                  sizeof(RguCDatIndInfo));
             ret = RFAILED;
-           break;
+            break;
          }
          oduCpyFixBufToMsg(ulData->pduInfo[idx].pduBuf, cLchUlDat->pdu, \
-           ulData->pduInfo[idx].pduLen);
+               ulData->pduInfo[idx].pduLen);
 
          rlcProcCommLcUlData(pst, 0, cLchUlDat);
       }
@@ -396,34 +513,34 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
          if(!dLchPduPres)
          {
             RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_UL, RLC_POOL, dLchUlDat, \
-              sizeof(RguDDatIndInfo));
-           if(!dLchUlDat)
-           {
-              DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
-              ret = RFAILED;
-              break;
-           }
+                  sizeof(RguDDatIndInfo));
+            if(!dLchUlDat)
+            {
+               DU_LOG("\nERROR  -->  RLC : Memory allocation failed at RlcMacProcUlData");
+               ret = RFAILED;
+               break;
+            }
             dLchPduPres = TRUE;
          }
 
-        /* Copy fixed buffer to message */
-        lcId = ulData->pduInfo[idx].lcId;
-        if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, \
-                 &dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]) != ROK)
-        {
-           DU_LOG("\nRLC : Memory allocation failed at RlcMacProcUlData");
-           for(pduIdx=0; pduIdx < dLchData[lcId].pdu.numPdu; pduIdx++)
-           {
-              ODU_PUT_MSG_BUF(dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]);
-           }
-           RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, dLchUlDat, \
-              sizeof(RguDDatIndInfo));
-           ret = RFAILED;
-           break;
-        }
-        oduCpyFixBufToMsg(ulData->pduInfo[idx].pduBuf, \
-              dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu],\
-              ulData->pduInfo[idx].pduLen);
+         /* Copy fixed buffer to message */
+         lcId = ulData->pduInfo[idx].lcId;
+         if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, \
+                  &dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]) != ROK)
+         {
+            DU_LOG("\nERROR  -->  RLC : Memory allocation failed at RlcMacProcUlData");
+            for(pduIdx=0; pduIdx < dLchData[lcId].pdu.numPdu; pduIdx++)
+            {
+               ODU_PUT_MSG_BUF(dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu]);
+            }
+            RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_UL, RLC_POOL, dLchUlDat, \
+                  sizeof(RguDDatIndInfo));
+            ret = RFAILED;
+            break;
+         }
+         oduCpyFixBufToMsg(ulData->pduInfo[idx].pduBuf, \
+               dLchData[lcId].pdu.mBuf[dLchData[lcId].pdu.numPdu],\
+               ulData->pduInfo[idx].pduLen);
 
          dLchData[lcId].pdu.numPdu++;
       }
@@ -435,26 +552,26 @@ uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
    {
       if(dLchPduPres)
       {
-        dLchUlDat->cellId = ulData->cellId;
-        dLchUlDat->rnti   = ulData->rnti;
-
-        for(idx = 0; idx < MAX_NUM_LC; idx++)
-        {
-           if(dLchData[idx].pdu.numPdu)
-           {
-              memcpy(&dLchUlDat->lchData[numDLch], &dLchData[idx], sizeof(RguLchDatInd));
-              numDLch++;
-           }
-        }
-        dLchUlDat->numLch = numDLch;
-        rlcProcDedLcUlData(pst, 0, dLchUlDat);
+         dLchUlDat->cellId = ulData->cellId;
+         GET_UE_ID(ulData->rnti, dLchUlDat->rnti);
+
+         for(idx = 0; idx < MAX_NUM_LC; idx++)
+         {
+            if(dLchData[idx].pdu.numPdu)
+            {
+               memcpy(&dLchUlDat->lchData[numDLch], &dLchData[idx], sizeof(RguLchDatInd));
+               numDLch++;
+            }
+         }
+         dLchUlDat->numLch = numDLch;
+         rlcProcDedLcUlData(pst, 0, dLchUlDat);
       }
    }
 
    for(pduIdx = 0; pduIdx < ulData->numPdu; pduIdx++)
    {
       RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData->pduInfo[pduIdx].pduBuf, \
-         ulData->pduInfo[pduIdx].pduLen);
+            ulData->pduInfo[pduIdx].pduLen);
    }
    RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ulData, sizeof(RlcData));
    return ROK;
@@ -487,8 +604,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep)
    RguCStaIndInfo   *cLchSchInfo;    /* Common logical channel scheduling result */
    RguDStaIndInfo   *dLchSchInfo;  /* Dedicated logical channel scheduling result */
 
-   DU_LOG("\nRLC : Received scheduling report from MAC");
-
+   DU_LOG("\nDEBUG  -->  RLC : Received scheduling report from MAC");
    for(idx=0; idx < schRep->numLc; idx++)
    {
       /* If it is common channel, fill status indication information
@@ -499,7 +615,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep)
             sizeof(RguCStaIndInfo));
          if(!cLchSchInfo)
          {
-            DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for cLchSchInfo");
+            DU_LOG("\nERROR  -->  RLC: RlcProcSchedResultRpt: Memory allocation failed for cLchSchInfo");
             ret = RFAILED;
             break;
          }
@@ -523,7 +639,7 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep)
                sizeof(RguDStaIndInfo));
              if(!dLchSchInfo)
              {
-                DU_LOG("\nRLC: RlcProcSchedResultRpt: Memory allocation failed for dLchSchInfo");
+                DU_LOG("\nERROR  -->  RLC: RlcProcSchedResultRpt: Memory allocation failed for dLchSchInfo");
                 ret = RFAILED;
                 break;
              }
@@ -565,6 +681,399 @@ uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRep)
    return ret;
 }
 
+
+/*******************************************************************
+ *
+ * @brief Handles Ue Reconfig Request from DU APP
+ *
+ * @details
+ *
+ *    Function : RlcProcUeReconfigReq
+ *
+ *    Functionality:
+ *      Handles Ue Reconfig Request from DU APP
+ *
+ * @params[in] Post structure pointer
+ *             RlcUeCfg pointer 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg)
+{
+   uint8_t ret = ROK;
+   RlcCfgInfo *rlcUeCfg = NULLP; //Seed code Rlc cfg struct
+   RlcCb *rlcUeCb = NULLP;
+   RlcCfgCfmInfo cfgRsp; 
+   Pst rspPst;
+
+   DU_LOG("\nDEBUG  -->  RLC: UE reconfig request received. CellID[%d] UEID[%d]",ueCfg->cellId, ueCfg->ueId);
+
+   rlcUeCb = RLC_GET_RLCCB(pst->dstInst);
+   RLC_ALLOC(rlcUeCb, rlcUeCfg, sizeof(RlcCfgInfo));
+   if(rlcUeCfg == NULLP)
+   {
+      DU_LOG("\nERROR  -->  RLC: Failed to allocate memory at RlcProcUeReconfigReq()");
+      ret = RFAILED;
+   }
+   else
+   {
+      memset(rlcUeCfg, 0, sizeof(RlcCfgInfo));
+      ret = fillRlcCfg(rlcUeCb, rlcUeCfg, ueCfg);
+      if(ret != ROK)
+      {
+         DU_LOG("\nERROR  -->  RLC: Failed to fill configuration at RlcProcUeReconfigReq()");
+         FILL_PST_RLC_TO_DUAPP(rspPst, RLC_UL_INST, EVENT_RLC_UE_RECONFIG_RSP);
+         fillRlcCfgFailureRsp(&cfgRsp, ueCfg);
+         SendRlcUeCfgRspToDu(&rspPst, &cfgRsp);
+      }
+      else
+      {
+         ret = RlcProcCfgReq(pst, rlcUeCfg);
+         if(ret != ROK)
+            DU_LOG("\nERROR  -->  RLC: Failed to configure Add/Mod/Del entities at RlcProcUeReconfigReq()");
+      }
+   }
+   
+   RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));
+   return ret;
+}
+
+/* ****************************************************************
+ *
+ * @brief Process the DL Data transfer from DU APP
+ *
+ * @details
+ *
+ *    Function : RlcProcDlUserDataTransfer
+ *
+ *    Functionality: Process the DL transfer from DU APP
+ *
+ * @params[in] Post structure
+ *             DL RRC Message info
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo)
+{
+   Buffer        *mBuf = NULLP;
+   RlcDatReqInfo *datReqInfo = NULLP;
+
+   if(dlDataMsgInfo->dlMsg == NULLP)
+   {
+      DU_LOG("\nERROR  -->  RLC_DL : Received DL message is NULLP in RlcProcDlUserDataTransfer()");
+      return RFAILED;
+   }
+   RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo));
+   if(!datReqInfo)
+   {
+      DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed for DatReq in RlcProcDlUserDataTransfer()");
+      ODU_PUT_MSG_BUF(dlDataMsgInfo->dlMsg);
+      RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
+      return RFAILED;
+   }
+
+   datReqInfo->rlcId.rbType = RB_TYPE_DRB;
+   datReqInfo->rlcId.rbId   = dlDataMsgInfo->rbId;
+   datReqInfo->rlcId.ueId   = dlDataMsgInfo->ueId;
+   datReqInfo->rlcId.cellId = dlDataMsgInfo->cellId;
+   datReqInfo->lcType       = LCH_DTCH;
+   datReqInfo->sduId        = ++(rlcCb[pst->dstInst]->dlSduId);
+   mBuf = dlDataMsgInfo->dlMsg;
+   if(rlcProcDlData(pst, datReqInfo, mBuf) != ROK)
+   {
+      return RFAILED;
+   }
+    
+   /* Free memory allocated by du app */
+   RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(RlcDatReqInfo));
+   RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief sending UE delete response to DU 
+ *
+ * @details
+ *
+ *    Function : sendRlcUeDeleteRspToDu 
+ *
+ *    Functionality:
+ *      sending UE delete response to DU 
+ *
+ * @params[in] uint8_t cellId, uint8_t ueId, UeDeleteResult result 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult result)
+{
+   Pst pst;  
+   RlcUeDeleteRsp *ueDeleteRsp = NULLP;
+   
+   FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_UE_DELETE_RSP);
+
+   RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+   if(!ueDeleteRsp)
+   {
+      DU_LOG("\nERROR  -->  RLC: sendRlcUeDeleteRspToDu(): Memory allocation failed ");
+      return RFAILED;
+   }
+   else
+   {
+      ueDeleteRsp->cellId = cellId;
+      ueDeleteRsp->ueId = ueId;
+      ueDeleteRsp->result = result;
+  
+      if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
+      {
+         DU_LOG("\nDEBUG  -->  RLC: UE Delete response send successfully");
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  RLC: SendRlcUeDeleteRspToDu():Failed to send UE Delete response to DU");
+         RLC_FREE_SHRABL_BUF(pst.region, pst.pool, ueDeleteRsp, sizeof(RlcUeDeleteRsp));
+         return RFAILED;
+      }
+   }
+   return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Handles Ue delete Request from DU APP
+*
+* @details
+*
+*    Function : RlcProcUeDeleteReq
+*
+*    Functionality:
+*      Handles Ue delete Request from DU APP
+*
+* @params[in] Post structure pointer
+*             RlcUeDelete pointer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
+{
+   uint8_t ret = ROK;
+   RlcCb *gRlcCb = NULLP;
+   RlcUlUeCb *ueCb = NULLP;
+   UeDeleteResult result=SUCCESSFUL;
+
+   DU_LOG("\nDEBUG  -->  RLC: UE Delete request received. CellID[%d] UEID[%d]",ueDelete->cellId, ueDelete->ueId);
+
+   if(ueDelete != NULLP)
+   {
+      gRlcCb = RLC_GET_RLCCB(pst->dstInst);
+      rlcDbmFetchUlUeCb(gRlcCb,ueDelete->ueId, ueDelete->cellId, &ueCb);
+      if(ueCb != NULLP)
+      {
+         if(ueDelete->cellId == ueCb->cellId)
+         {
+            memcpy(&ueCb->ueDeleteInfo.pst, pst, sizeof(Pst));
+            if((rlcChkTmr(gRlcCb, (PTR)ueCb, EVENT_RLC_UE_DELETE_TMR)) == FALSE)
+            {
+               rlcStartTmr(gRlcCb,(PTR)ueCb, EVENT_RLC_UE_DELETE_TMR);
+            }
+         }
+         else
+         {
+            result = INVALID_CELLID;
+         }
+      }
+      else
+      {
+         result = INVALID_UEID;
+      }
+
+      if(result != SUCCESSFUL)
+      {
+         ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, result);
+         if(ret != ROK)
+         {
+            DU_LOG("\nERROR  -->  RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
+         }
+      }
+      RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(RlcUeDelete));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC: RlcProcUeDeleteReq(): Recieved NULL pointer UE Delete ");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+*
+* @brief Send the Slice Metrics to  DU APP
+*
+* @details
+*
+*    Function : sendSlicePmToDu
+*
+*    Functionality:
+*      Handles the sending of Slice Metrics to  DU APP
+*
+* @params[in] Post structure pointer
+*             SlicePmList *sliceStats pointer
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t sendSlicePmToDu(SlicePmList *sliceStats)
+{
+   Pst pst;  
+   
+   FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_SLICE_PM_TO_DU);
+
+   if(!sliceStats)
+   {
+      DU_LOG("\nERROR  -->  RLC: sendSlicePmToDu(): Memory allocation failed ");
+      return RFAILED;
+   }
+   else
+   {
+      if(rlcSendSlicePmToDu(&pst, sliceStats) == ROK)
+      {
+         DU_LOG("\nDEBUG  -->  RLC: Slice PM send successfully");
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  RLC: sendSlicePmToDu():Failed to send Slice PM to DU");
+         RLC_FREE_SHRABL_BUF(pst.region, pst.pool, sliceStats, sizeof(SlicePmList));
+         return RFAILED;
+      }
+   }
+   return ROK;
+}
+
+/**
+ * @brief 
+ *    Handler for searching the Slice Entry in Slice Metrics structure
+ *
+ * @details
+ *    This func finds the slice entry in the SliceMetric record structure and
+ *    return the index of the slice sot hat Tput entries can be done
+ *
+ * @param[in] snssaiVal : Snssai Val to be searched
+ *            *snssaiIdx : O/P : Index of the Slice in Slice Metrics record
+ *            sliceStats : Pointer of Slice metrics record list
+ *
+ * @return bool: True: If slice found in the record
+ *               False: If Slice not found; thus parent function will create the
+ *               recpord of this snssai
+ *   
+ */
+bool rlcFindSliceEntry(SliceIdentifier snssaiVal, uint8_t *snssaiIdx, SlicePmList *sliceStats)
+{
+   uint8_t cntSlices = sliceStats->numSlice;
+
+   for(*snssaiIdx = 0;(*snssaiIdx) < cntSlices; (*snssaiIdx)++)
+   {
+      if((snssaiVal.sst == sliceStats->sliceRecord[*snssaiIdx].networkSliceIdentifier.sst)&&
+            (snssaiVal.sd == sliceStats->sliceRecord[*snssaiIdx].networkSliceIdentifier.sd))
+      {
+         return TRUE;
+      }
+   }
+   return FALSE;
+}
+
+
+/*******************************************************************
+*
+* @brief Builds the Slice Performance Metrics structure to be sent to DU
+*
+* @details
+*
+*    Function : BuildSliceReportToDu
+*
+*    Functionality:
+*      Builds the Slice Performance Metrics structure to be sent to DU
+*
+* @params[in] uint8_t snssaiCnt
+*             
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildSliceReportToDu(uint8_t snssaiCnt)
+{
+   CmLList  *node = NULLP;
+   RlcTptPerSnssai *snssaiNode = NULLP;
+   Direction dir = DIR_UL;
+   SlicePmList *sliceStats = NULLP;   /*Slice metric */
+   SliceIdentifier snssaiVal ;
+   uint8_t snssaiIdx = 0;
+
+   if(snssaiCnt == 0)
+   {
+      DU_LOG("\nERROR  -->  RLC: No SNSSAI to send the SLice PM");
+      return RFAILED;
+   }
+
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+   if(sliceStats == NULLP)
+   {
+      DU_LOG("\nERROR  -->  RLC: Memory Allocation Failed");
+      return RFAILED;
+   }
+   RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats->sliceRecord, snssaiCnt * (sizeof(SlicePm)));
+
+   if(sliceStats->sliceRecord == NULLP)
+   {
+      DU_LOG("\nERROR  -->  RLC: Memory Allocation Failed");
+      RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+      return RFAILED;
+   }
+   while(dir < DIR_BOTH)
+   {
+      node = arrTputPerSnssai[dir]->first;
+      if(node == NULLP)
+      {
+         DU_LOG("\nERROR  -->  RLC: No SNSSAI in list");
+         RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats, sizeof(SlicePmList));
+         RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, sliceStats->sliceRecord, (snssaiCnt * (sizeof(SlicePm))));
+         return RFAILED;
+      }
+
+      while(node)
+      {
+         snssaiIdx = 0;
+         snssaiNode = (RlcTptPerSnssai *)node->node;
+
+         snssaiVal.sst = snssaiNode->snssai->sst;
+         snssaiVal.sd = snssaiNode->snssai->sd[2]+snssaiNode->snssai->sd[1]*10+snssaiNode->snssai->sd[0]*100;
+         if(rlcFindSliceEntry(snssaiVal, &snssaiIdx, sliceStats) == FALSE)
+         {
+            sliceStats->sliceRecord[snssaiIdx].networkSliceIdentifier = snssaiVal;
+            sliceStats->numSlice++;
+         }
+         if(dir == DIR_UL)
+         {
+            sliceStats->sliceRecord[snssaiIdx].ThpUl = snssaiNode->tpt;
+         }
+         else
+         {
+            sliceStats->sliceRecord[snssaiIdx].ThpDl = snssaiNode->tpt;
+         }
+         node = node->next;
+      }
+      dir++;
+   }
+
+   sendSlicePmToDu(sliceStats);
+   return ROK;
+}
 /**********************************************************************
          End of file
 **********************************************************************/