[Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-501] WG8 Alignment | RLC Max Retransmission... 46/10746/4
authorlal.harshita <Harshita.Lal@radisys.com>
Fri, 17 Mar 2023 15:15:21 +0000 (20:45 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Tue, 21 Mar 2023 08:18:50 +0000 (13:48 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: Iaf8953499fb7a5bcd7aee1665d3e8c4de73f18b1
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_upr_inf_api.c
src/5gnrrlc/rlc_upr_inf_api.h
src/cm/du_app_rlc_inf.c
src/cm/du_app_rlc_inf.h
src/du_app/du_mgr_msg_router.c
src/du_app/du_ue_mgr.c

index 54c3b5c..a102deb 100644 (file)
 #include "du_app_rlc_inf.h"
 #include "rlc_upr_inf_api.h"
 #include "rlc_mgr.h"
+
+/*******************************************************************
+ *
+ * @brief building and sending UE max retransmission info to DU 
+ *
+ * @details
+ *
+ *    Function : BuildAndSendRlcMaxRetransIndToDu 
+ *
+ *    Functionality:
+ *      Building and sending UE  max retransmission information to DU 
+ *
+ * @params[in] uint8_t cellId, uint8_t ueId, CauseOfResult  status 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t BuildAndSendRlcMaxRetransIndToDu(uint16_t cellId,uint8_t ueId, uint8_t lcId, uint8_t lcType)
+{
+   Pst pst;  
+   RlcMaxRetransInfo *maxRetransInfo = NULLP;
+   
+   FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RLC_MAX_RETRANSMISSION);
+
+   RLC_ALLOC_SHRABL_BUF(pst.region, pst.pool, maxRetransInfo, sizeof(RlcMaxRetransInfo));
+   if(!maxRetransInfo)
+   {
+      DU_LOG("\nERROR  -->  RLC: sendRlcMaxRetransIndToDu(): Memory allocation failed ");
+      return RFAILED;
+   }
+   else
+   {
+      maxRetransInfo->cellId = cellId;
+      maxRetransInfo->ueId = ueId;
+      maxRetransInfo->lcId = lcId;
+      maxRetransInfo->lcType = lcType;
+  
+      if(rlcSendMaxRetransIndToDu(&pst, maxRetransInfo) == ROK)
+      {
+         DU_LOG("\nDEBUG  -->  RLC: UE [ %d] max retransmission information sent successfully",ueId);
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  RLC: SendRlcMaxRetransIndToDu(): fail to send UeId's[%d] maximum retransmission information", ueId);
+         RLC_FREE_SHRABL_BUF(pst.region, pst.pool, maxRetransInfo, sizeof(RlcMaxRetransInfo));
+         return RFAILED;
+      }
+   }
+   return ROK;
+}
+
 /*******************************************************************
  *
  * @brief Fills RLC UL UE Cfg Rsp from RlcCRsp 
@@ -756,7 +808,7 @@ uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueRecfg)
    RlcCb *rlcUeCb = NULLP;
    RlcCfgCfmInfo cfgRsp; 
    Pst rspPst;
-
+   
    DU_LOG("\nDEBUG  -->  RLC: UE reconfig request received. CellID[%d] UEID[%d]",ueRecfg->cellId, ueRecfg->ueId);
 
    rlcUeCb = RLC_GET_RLCCB(pst->dstInst);
@@ -1120,7 +1172,7 @@ uint8_t BuildSliceReportToDu(uint8_t snssaiCnt)
       }
       dir++;
    }
-
+   
    sendSlicePmToDu(sliceStats);
    return ROK;
 }
index bc00bf3..ae28ef6 100644 (file)
@@ -26,6 +26,13 @@ RlcUlRrcMsgToDuFunc rlcSendUlRrcMsgToDuOpts[] =
    packRlcUlRrcMsgToDu        /* 2 - Light weight loosely coupled */
 };
 
+RlcDuMaxRetransInd rlcMaxRetransIndOpts[] =
+{
+   packRlcDuMaxRetransInd,     /* 0 - loosely coupled */
+   DuProcRlcMaxRetransInd,     /* 1 - tightly coupled */
+   packRlcDuMaxRetransInd     /* 2 - LWLC loosely coupled */
+};
+
 RlcRrcDeliveryReportToDuFunc rlcSendRrcDeliveryReportToDuOpts[]=
 {
    packRrcDeliveryReportToDu,          /* 0 - Loosely coupled */
@@ -91,6 +98,27 @@ uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
    return (*rlcSendUlRrcMsgToDuOpts[pst->selector])(pst, ulRrcMsgInfo);
 }
 
+/*******************************************************************
+*
+* @brief Sends max retransmission reached Info to DU APP
+*
+* @details
+*
+*    Function : rlcSendMaxRetransIndToDu 
+*
+*    Functionality:  Sends  max retransmission reached Info to DU APP
+*
+* @params[in] Pst structure
+*              max retransmission reached Info
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t rlcSendMaxRetransIndToDu(Pst *pst, RlcMaxRetransInfo *maxRetransInfo) 
+{
+   return (*rlcMaxRetransIndOpts[pst->selector])(pst, maxRetransInfo);
+}
+
 /*******************************************************************
 *
 * @brief Sends RRC delivery Message Info to DU APP
index 70f3013..9299942 100644 (file)
@@ -16,6 +16,7 @@
 ################################################################################
 *******************************************************************************/
 
+uint8_t rlcSendMaxRetransIndToDu(Pst *pst, RlcMaxRetransInfo *maxRetransInfo);
 uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
 uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery);
 uint8_t rlcSendDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
index 417df5b..dcfb9b9 100644 (file)
 #include "common_def.h"
 #include "du_app_rlc_inf.h"
 
+/*******************************************************************
+*
+* @brief Packs and Sends Max Retransmission Reached Info from RLC to DUAPP
+*
+* @details
+*
+*    Function : packRlcDuMaxRetransInd
+*
+*    Functionality:
+*       Packs and Sends Max Retransmission Reached Info from RLC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+*             RlcMaxRetransInfo *maxRetransInfo
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInfo)
+{
+   Buffer *mBuf = NULLP;
+
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDuMaxRetransInd");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)maxRetransInfo, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcDuMaxRetransInd");
+      return RFAILED;
+   }
+
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Max Retransmission Reached Info received from DU APP
+*
+* @details
+*
+*    Function : unpackRlcMaxRetransInd
+*
+*    Functionality:
+*         Unpacks Max Retransmission Reached Info received from DU APP
+*
+* @params[in] Pointer to Handler
+*             Post structure pointer
+*             Message Buffer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       RlcMaxRetransInfo *maxRetransInfo = NULLP;
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&maxRetransInfo, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, maxRetransInfo);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for Max Retransmission Reached Info ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+
+    return RFAILED;
+}
+
 /*******************************************************************
  *
  * @brief Packs and Sends UE create Request from DUAPP to RLC
index ebf0cdd..d35b144 100644 (file)
@@ -36,6 +36,7 @@
 #define EVENT_RLC_SLICE_PM_TO_DU 222
 #define EVENT_RLC_UE_REESTABLISH_REQ 223
 #define EVENT_RLC_UE_REESTABLISH_RSP 224
+#define EVENT_RLC_MAX_RETRANSMISSION 225
 
 #define RB_ID_SRB 0
 #define RB_ID_DRB 1
@@ -120,6 +121,16 @@ typedef enum
    RLC_DU_APP_RSP_NOK
 }RlcRsp;
 
+/*  Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.10 RLC Max Retransmission Reached */
+
+typedef struct rlcMaxRetransInd 
+{
+   uint16_t       cellId;
+   uint16_t       ueId;
+   RlcRbType      lcType;
+   uint8_t        lcId;
+}RlcMaxRetransInfo;
+
 typedef struct ulAmCfg
 {
    SnLenAm        snLenUl;              /* Sequence Number length in bits. Allowed values are 12 and 18 */
@@ -342,6 +353,12 @@ typedef struct rlcUeReestablishRsp
 }RlcUeReestablishRsp;
 
 /* Function Pointers */
+
+/* Max Retransmission  from RLC to DU APP*/
+typedef uint8_t (*RlcDuMaxRetransInd) ARGS((
+         Pst          *pst,
+         RlcMaxRetransInfo *maxRetransInfo));
+
 /* UE create Request from DU APP to RLC*/
 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
    Pst           *pst,
@@ -413,6 +430,8 @@ typedef uint8_t (*RlcDuUeReestablishRsp) ARGS((
    RlcUeReestablishRsp  *ueDelRsp));
 
 /* Pack/Unpack function declarations */
+uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
+uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd  func, Pst *pst, Buffer *mBuf);
 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
@@ -443,6 +462,7 @@ uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRs
 uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf);
 
 /* Event Handler function declarations */
+uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
index 79f7cc7..c78102a 100644 (file)
@@ -460,6 +460,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
                      ret = unpackRlcDlRrcMsgRspToDu(DuProcRlcDlRrcMsgRsp, pst, mBuf);
                      break;
                   }
+               case EVENT_RLC_MAX_RETRANSMISSION:
+                  {
+                     ret = unpackRlcMaxRetransInd(DuProcRlcMaxRetransInd, pst, mBuf);
+                     break;
+                  }
                case EVENT_UL_USER_DATA_TRANS_TO_DU:
                   {
                      ret = unpackRlcUlUserDataToDu(DuProcRlcUlUserDataTrans, pst, mBuf);
index 98faa71..813d22b 100644 (file)
@@ -129,6 +129,55 @@ DuMacUeResetReq packMacUeResetReqOpts[] =
    MacProcUeResetReq,         /* TIght coupling */
    packDuMacUeResetReq        /* Light weight-loose coupling */
 };
+
+/*******************************************************************
+ *
+ * @brief Processes UE's max retransmission information received from RLC 
+ *
+ * @details
+ *
+ *    Function : DuProcRlcMaxRetransInd
+ *
+ *    Functionality:
+ *     Processes max retransmission reached information received from RLC 
+ *
+ *  @params[in]  Post structure
+ *               Pointer to RlcMaxRetransInfo
+ *  @return ROK     - success
+ *          RFAILED - failure
+ *
+ * *****************************************************************/
+
+uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInfo)
+{
+   uint8_t  ueId = 0, ret = RFAILED;
+   uint16_t cellIdx = 0,crnti=0;
+
+   if(maxRetransInfo)
+   {
+      GET_CELL_IDX(maxRetransInfo->cellId, cellIdx);
+
+      if(duCb.actvCellLst[cellIdx]!=NULLP)
+      {
+         ueId = maxRetransInfo->ueId;
+         GET_CRNTI(crnti, ueId);
+         if(duCb.actvCellLst[cellIdx]->ueCb[ueId-1].crnti ==  crnti)
+         {
+            /*TODO: complete the processing of max retransmission */
+            ret = ROK;
+         }
+         else
+            DU_LOG("\nERROR  -->  DU APP : DuProcRlcMaxRetransInd(): CRNTI [%d] not found", crnti);
+      }
+      else
+         DU_LOG("\nERROR  -->  DU APP : DuProcRlcMaxRetransInd(): Cell Id[%d] is not found", maxRetransInfo->cellId);
+      
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, maxRetransInfo, sizeof(RlcMaxRetransInfo));
+
+   }
+   return ret;
+}
+
 /******************************************************************
  *
  * @brief Function to return Drb LcId