From fed126358e8ddf1cb94f28740eb668b665685ea9 Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Fri, 17 Mar 2023 20:45:21 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-501] WG8 Alignment | RLC Max Retransmission Reached Signed-off-by: lal.harshita Change-Id: Iaf8953499fb7a5bcd7aee1665d3e8c4de73f18b1 Signed-off-by: lal.harshita --- src/5gnrrlc/rlc_msg_hdl.c | 56 +++++++++++++++++++++++++++-- src/5gnrrlc/rlc_upr_inf_api.c | 28 +++++++++++++++ src/5gnrrlc/rlc_upr_inf_api.h | 1 + src/cm/du_app_rlc_inf.c | 82 ++++++++++++++++++++++++++++++++++++++++++ src/cm/du_app_rlc_inf.h | 20 +++++++++++ src/du_app/du_mgr_msg_router.c | 5 +++ src/du_app/du_ue_mgr.c | 49 +++++++++++++++++++++++++ 7 files changed, 239 insertions(+), 2 deletions(-) diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 54c3b5c56..a102debcd 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -40,6 +40,58 @@ #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; } diff --git a/src/5gnrrlc/rlc_upr_inf_api.c b/src/5gnrrlc/rlc_upr_inf_api.c index bc00bf35e..ae28ef62d 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.c +++ b/src/5gnrrlc/rlc_upr_inf_api.c @@ -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 diff --git a/src/5gnrrlc/rlc_upr_inf_api.h b/src/5gnrrlc/rlc_upr_inf_api.h index 70f30135e..9299942ca 100644 --- a/src/5gnrrlc/rlc_upr_inf_api.h +++ b/src/5gnrrlc/rlc_upr_inf_api.h @@ -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); diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 417df5b20..dcfb9b950 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -19,6 +19,88 @@ #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 diff --git a/src/cm/du_app_rlc_inf.h b/src/cm/du_app_rlc_inf.h index ebf0cdde4..d35b1440c 100644 --- a/src/cm/du_app_rlc_inf.h +++ b/src/cm/du_app_rlc_inf.h @@ -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); diff --git a/src/du_app/du_mgr_msg_router.c b/src/du_app/du_mgr_msg_router.c index 79f7cc7c2..c78102a34 100644 --- a/src/du_app/du_mgr_msg_router.c +++ b/src/du_app/du_mgr_msg_router.c @@ -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); diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 98faa7114..813d22bc7 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -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 -- 2.16.6