From 2e79829c81833df467daa9cce57a967d2224876e Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Thu, 18 Feb 2021 16:49:27 +0530 Subject: [PATCH] [JIRA ID - ODUHIGH-291]: Code changes for RLC UL AMD PDU Change-Id: Ic03bc41bed51985a2f019b44dff415cc43291480 Signed-off-by: sphoorthi --- src/5gnrrlc/kw.h | 2 +- src/5gnrrlc/kw.x | 4 +- src/5gnrrlc/kw_amm_ul.c | 66 ++++++++++---------- src/5gnrrlc/kw_cfg_ul.c | 6 +- src/5gnrrlc/kw_tmr.c | 20 +++---- src/5gnrrlc/kw_ul.x | 11 ++-- src/5gnrrlc/kw_utl_dl.c | 16 ++--- src/5gnrrlc/rlc_msg_hdl.c | 2 +- src/cm/ckw.c | 4 +- src/cm/ckw.x | 2 +- src/cm/du_app_rlc_inf.h | 122 +------------------------------------ src/du_app/du_cfg.h | 6 +- src/du_app/du_f1ap_msg_hdl.c | 130 +++++++++++++++++++++++++++++++++++++++- src/du_app/du_f1ap_msg_hdl.h | 2 + src/du_app/du_ue_mgr.c | 8 +-- src/phy_stub/phy_stub_msg_hdl.c | 17 +++--- 16 files changed, 221 insertions(+), 197 deletions(-) diff --git a/src/5gnrrlc/kw.h b/src/5gnrrlc/kw.h index 4ef9c79b7..f23f1deb9 100755 --- a/src/5gnrrlc/kw.h +++ b/src/5gnrrlc/kw.h @@ -446,7 +446,7 @@ /* Timer events */ #define EVENT_RLC_UMUL_REASSEMBLE_TMR 1 -#define EVENT_RLC_AMUL_REORD_TMR 2 +#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2 #define EVENT_RLC_AMUL_STA_PROH_TMR 3 #define EVENT_RLC_AMDL_POLL_RETX_TMR 4 #define EVENT_RLC_WAIT_BNDCFM 5 diff --git a/src/5gnrrlc/kw.x b/src/5gnrrlc/kw.x index 95b2ecf6e..7c6f62b86 100755 --- a/src/5gnrrlc/kw.x +++ b/src/5gnrrlc/kw.x @@ -58,7 +58,7 @@ typedef struct _amRlcStats uint32_t numDLMaxRetx; uint32_t numDLRetransPdus; uint32_t numULPdusDiscarded; - uint32_t numULReOrdTimerExpires; + uint32_t numULReAsmblTimerExpires; uint32_t numULStaPduRcvd; uint32_t numULNackInStaPduRcvd; uint32_t numRlcAmCellSduTx; /* Count of SDUs transmitted in DL for all UEs */ @@ -78,7 +78,7 @@ typedef struct _umRlcStats uint32_t numDLBytesUnused; uint32_t numDLMaxRetx; uint32_t numULPdusDiscarded; - uint32_t numULReOrdTimerExpires; + uint32_t numULReAsmblTimerExpires; uint32_t numULPdusOutsideWindow; }UMRLCStats; diff --git a/src/5gnrrlc/kw_amm_ul.c b/src/5gnrrlc/kw_amm_ul.c index 86056d000..afdd33499 100755 --- a/src/5gnrrlc/kw_amm_ul.c +++ b/src/5gnrrlc/kw_amm_ul.c @@ -691,29 +691,34 @@ void rlcAmmProcessPdus(RlcCb *gCb, RlcUlRbCb *rbCb, KwPduInfo *pduInfo) } } - /* Check if reOrdTmr is running and update rxNextStatusTrig accordingly */ - tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + /* Check if reAsmblTmr is running and update rxNextStatusTrig accordingly */ + tmrRunning = rlcChkTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); if (tmrRunning) { Bool snInWin = RLC_AM_CHK_SN_WITHIN_RECV_WINDOW(amUl->rxNextStatusTrig, amUl); - - if ( (amUl->rxNextStatusTrig == amUl->rxNext) || ( (!snInWin) && - (amUl->rxNextStatusTrig != amUl->vrMr) ) ) + /* spec 38.322v15.3.0 - 5.2.3.2.3 */ + if((amUl->rxNextStatusTrig == amUl->rxNext) || ( (!snInWin) && + (amUl->rxNextStatusTrig != amUl->vrMr) )|| + (amUl->rxNextStatusTrig == amUl->rxNext && recBuf &&recBuf->noMissingSeg)) { - rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); tmrRunning = FALSE; + DU_LOG("\nINFO --> RLC_UL: rlcAmmProcessPdus: Stopped ReAssembly Timer rxNextStatusTigger = %d" + "rxNextReassembly = %d", amUl->rxNextStatusTrig, amUl->rxNext); } } if (!tmrRunning) { - if (amUl->rxNextHighestRcvd > amUl->rxNext) + /* spec 38.322v15.3.0 - 5.2.3.2.3 */ + if((amUl->rxNextHighestRcvd > amUl->rxNext) || ((amUl->rxNextHighestRcvd == amUl->rxNext) && + (recBuf && (!recBuf->noMissingSeg)))) { - rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd; - DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextStatusTrig = %d \ - UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId, + DU_LOG("\nDEBUG --> RLC_UL : rlcAmmProcessPdus: Updated rxNextStatusTrig = %d" + "UEID:%d CELLID:%d", amUl->rxNextStatusTrig, rbCb->rlcId.ueId, rbCb->rlcId.cellId); } } @@ -804,7 +809,7 @@ static uint8_t rlcAmmExtractHdr(RlcCb *gCb, RlcUlRbCb *rbCb, Buffer *pdu, RlcAmH amHdr->sn = sn; } - if ((amHdr->si != 0) && (amHdr->si != 0x01)) + if ((amHdr->si != 0) && (amHdr->si != RLC_SI_FIRST_SEG)) { hdrInfo.len = RLC_SO_LEN_5GNR; rlcAmmExtractElmnt(gCb, pdu, &hdrInfo); @@ -1356,7 +1361,7 @@ static bool rlcAmmUlPlacePduInRecBuf(RlcCb *gCb, Buffer *pdu, RlcUlRbCb *rbCb, R * staTrg flag. * - If staProhTmr is not running, calculate cntrlBo, else it'll be * updated at the expiry of staProhTmr. - * - Expiry of reOrdTmr also will set staTrg flag. + * - Expiry of reAsmblTmr also will set staTrg flag. * * @param[in] gCb RLC instance control block * @param[in] rbCb Uplink RB control block @@ -1430,8 +1435,7 @@ static void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buf ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); } - //if (amHdr->fi & RLC_FI_FIRST_SEG) - if (amHdr->si == 0x01) + if (amHdr->si == RLC_SI_FIRST_SEG) {/* first Segment of the SDU */ if (RLC_AMUL.partialSdu != NULLP) { /* Some old SDU may be present */ @@ -1440,13 +1444,13 @@ static void rlcAmmProcPduOrSeg(RlcCb *gCb, RlcUlRbCb *rbCb, RlcAmHdr *amHdr, Buf RLC_AMUL.partialSdu = pdu; pdu = NULLP; } - else if(amHdr->si == 0x03) + else if(amHdr->si == RLC_SI_MID_SEG) {/* Middle or last segment of the SUD */ ODU_CAT_MSG(RLC_AMUL.partialSdu,pdu, M1M2); ODU_PUT_MSG_BUF(pdu); pdu = NULLP; } - else if (amHdr->si == 0x02) + else if (amHdr->si == RLC_SI_LAST_SEG) { ODU_CAT_MSG(pdu,RLC_AMUL.partialSdu,M2M1); ODU_PUT_MSG_BUF(RLC_AMUL.partialSdu); @@ -1573,9 +1577,9 @@ Void rlcAmmUlReEstablish(RlcCb *gCb,CmLteRlcId rlcId,Bool sendReEst,RlcUlRbCb * /* Discard remaining PDUs and bytesegments in recBuf */ /* Stop all timers and reset variables */ - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REORD_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REASSEMBLE_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); } if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_STA_PROH_TMR)) { @@ -1619,7 +1623,7 @@ Void rlcAmmUlReEstablish(RlcCb *gCb,CmLteRlcId rlcId,Bool sendReEst,RlcUlRbCb * * */ -Void rlcAmmReOrdTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) +Void rlcAmmReAsmblTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) { RlcAmUl *amUl = &(rbCb->m.amUl); RlcSn sn; @@ -1651,7 +1655,7 @@ Void rlcAmmReOrdTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) if (!tmrRunning) { - gRlcStats.amRlcStats.numULReOrdTimerExpires++; + gRlcStats.amRlcStats.numULReAsmblTimerExpires++; amUl->gatherStaPduInfo = TRUE; rlcAmmUlAssembleCntrlInfo(gCb, rbCb); } @@ -1665,14 +1669,16 @@ Void rlcAmmReOrdTmrExp(RlcCb *gCb,RlcUlRbCb *rbCb) /* Update rxNextStatusTrig */ MODAMR(amUl->rxNextHighestRcvd, mrxNextHighestRcvd, amUl->rxNext, amUl->snModMask); MODAMR(amUl->rxHighestStatus, mrxHighestStatus, amUl->rxNext, amUl->snModMask); - if (mrxNextHighestRcvd > mrxHighestStatus) + /* spec 38.322v15.3.0 - 5.2.3.2.4 */ + if((mrxNextHighestRcvd > mrxHighestStatus) || ((mrxNextHighestRcvd == mrxHighestStatus) && + ((recBuf) && !(recBuf->noMissingSeg)))) { - rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + rlcStartTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); amUl->rxNextStatusTrig = amUl->rxNextHighestRcvd; } return; -} /* rlcAmmReOrdTmrExp */ +} /* rlcAmmReAsmblTmrExp */ /** * @brief Handler for status prohibit timer expiry @@ -1812,11 +1818,10 @@ static void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { return; } - + recBuf->noMissingSeg = FALSE; newExpSo = seg->soEnd + 1; recBuf->expSo = newExpSo; - //lstRcvd = seg->amHdr.lsf; - if(seg->amHdr.si == 0x2) + if(seg->amHdr.si == RLC_SI_LAST_SEG) { lstRcvd = TRUE; } @@ -1826,7 +1831,7 @@ static void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { /* keep going ahead as long as the expectedSo match with the header so else store the expSo for later checking again */ - if(seg->amHdr.si == 0x2) + if(seg->amHdr.si == RLC_SI_LAST_SEG) { lstRcvd = TRUE; } @@ -1834,7 +1839,6 @@ static void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) { newExpSo = seg->soEnd + 1; recBuf->expSo = newExpSo; - //lstRcvd = seg->amHdr.lsf; RLC_LLIST_NEXT_SEG(recBuf->segLst, seg); } else @@ -1848,7 +1852,7 @@ static void rlcAmmUpdExpByteSeg(RlcCb *gCb, RlcAmUl *amUl, RlcSeg *seg) recBuf->allRcvd = TRUE; gRlcStats.amRlcStats.numRlcAmCellSduRx++; } - + recBuf->noMissingSeg = TRUE; return; } @@ -1873,9 +1877,9 @@ Void rlcAmmFreeUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb) windSz = (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen)) << 1; - if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REORD_TMR)) + if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_REASSEMBLE_TMR)) { - rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REORD_TMR); + rlcStopTmr(gCb,(PTR)rbCb, EVENT_RLC_AMUL_REASSEMBLE_TMR); } if(TRUE == rlcChkTmr(gCb,(PTR)rbCb,EVENT_RLC_AMUL_STA_PROH_TMR)) { diff --git a/src/5gnrrlc/kw_cfg_ul.c b/src/5gnrrlc/kw_cfg_ul.c index c9cc78d89..f7a0f2e38 100755 --- a/src/5gnrrlc/kw_cfg_ul.c +++ b/src/5gnrrlc/kw_cfg_ul.c @@ -352,7 +352,7 @@ static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfg rbCb->dir = RLC_DIR_BOTH; rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr; - rbCb->m.amUl.reOrdTmrInt = entCfg->m.amInfo.ul.reOrdTmr; + rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr; rbCb->m.amUl.snLen = entCfg->m.amInfo.ul.snLen; /* 5GNR */ @@ -365,7 +365,7 @@ static S16 rlcCfgFillUlRbCb(RlcCb *gCb,RlcUlRbCb *rbCb,RlcUlUeCb *ueCb,RlcEntCfg rbCb->m.amUl.snModMask = (1 << RLC_SN_LEN_18BITS) - 1; /* 5GNR */ } - cmInitTimers(&(rbCb->m.amUl.reOrdTmr), 1); + cmInitTimers(&(rbCb->m.amUl.reAsmblTmr), 1); cmInitTimers(&(rbCb->m.amUl.staProhTmr), 1); rbCb->m.amUl.vrMr = rbCb->m.amUl.rxNext + (RLC_AM_GET_WIN_SZ(rbCb->m.amUl.snLen)); @@ -433,7 +433,7 @@ static S16 rlcCfgUpdateUlRb(RlcCb *gCb,RlcUlRbCb *rbCb,void *ptr,RlcEntCfgInfo * rbCb->lch.lChId = entCfg->lCh[1].lChId; rbCb->lch.lChType = entCfg->lCh[1].type; rbCb->m.amUl.staProhTmrInt = entCfg->m.amInfo.ul.staProhTmr; - rbCb->m.amUl.reOrdTmrInt = entCfg->m.amInfo.ul.reOrdTmr; + rbCb->m.amUl.reAsmblTmrInt = entCfg->m.amInfo.ul.reAsmblTmr; break; } } diff --git a/src/5gnrrlc/kw_tmr.c b/src/5gnrrlc/kw_tmr.c index c0f2df3b9..dc5c79470 100755 --- a/src/5gnrrlc/kw_tmr.c +++ b/src/5gnrrlc/kw_tmr.c @@ -121,13 +121,13 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) arg.max = RLC_MAX_UM_TMR; break; } - case EVENT_RLC_AMUL_REORD_TMR: + case EVENT_RLC_AMUL_REASSEMBLE_TMR: { RlcAmUl* amUl = &(((RlcUlRbCb *)cb)->m.amUl); /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, amUl->reOrdTmrInt, gCb->genCfg.timeRes); + RLC_TMR_CALCUATE_WAIT(arg.wait, amUl->reAsmblTmrInt, gCb->genCfg.timeRes); - arg.timers = &amUl->reOrdTmr; + arg.timers = &amUl->reAsmblTmr; arg.max = RLC_MAX_AM_TMR; break; } @@ -228,9 +228,9 @@ void rlcStopTmr(RlcCb *gCb, PTR cb, uint8_t tmrType) arg.max = RLC_MAX_UM_TMR; break; } - case EVENT_RLC_AMUL_REORD_TMR: + case EVENT_RLC_AMUL_REASSEMBLE_TMR: { - arg.timers = &((RlcUlRbCb *)cb)->m.amUl.reOrdTmr; + arg.timers = &((RlcUlRbCb *)cb)->m.amUl.reAsmblTmr; arg.max = RLC_MAX_AM_TMR; break; } @@ -307,10 +307,10 @@ Void rlcTmrExpiry(PTR cb,S16 tmrEvnt) break; } - case EVENT_RLC_AMUL_REORD_TMR: + case EVENT_RLC_AMUL_REASSEMBLE_TMR: { RlcUlRbCb *ulRbCb = (RlcUlRbCb *)cb; - rlcAmmReOrdTmrExp(RLC_GET_RLCCB(ulRbCb->inst), ulRbCb); + rlcAmmReAsmblTmrExp(RLC_GET_RLCCB(ulRbCb->inst), ulRbCb); break; } case EVENT_RLC_AMUL_STA_PROH_TMR: @@ -366,10 +366,10 @@ bool rlcChkTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) return (((RlcUlRbCb *)cb)->m.umUl.reAsmblTmr.tmrEvnt == EVENT_RLC_UMUL_REASSEMBLE_TMR); } - case EVENT_RLC_AMUL_REORD_TMR: + case EVENT_RLC_AMUL_REASSEMBLE_TMR: { - return (((RlcUlRbCb *)cb)->m.amUl.reOrdTmr.tmrEvnt == - EVENT_RLC_AMUL_REORD_TMR); + return (((RlcUlRbCb *)cb)->m.amUl.reAsmblTmr.tmrEvnt == + EVENT_RLC_AMUL_REASSEMBLE_TMR); } case EVENT_RLC_AMUL_STA_PROH_TMR: { diff --git a/src/5gnrrlc/kw_ul.x b/src/5gnrrlc/kw_ul.x index daed3ed2d..f2e4e731a 100755 --- a/src/5gnrrlc/kw_ul.x +++ b/src/5gnrrlc/kw_ul.x @@ -164,6 +164,7 @@ typedef struct rlcAmRecBuf uint16_t expSo; /**< Next expected seg offset */ Bool allRcvd; /**< All bytes received or not */ Bool isDelvUpperLayer; /**< Is it sent to upper layer */ + Bool noMissingSeg; /*!< Flag to check all the bytes are received before the last byte of segment */ }RlcAmRecBuf; /** @addtogroup ammode */ @@ -186,8 +187,8 @@ typedef struct rlcAmRecBuf * - expSo : The expected SO for reassembly * - staProhTmr : The Status Probihit Timer * - staProhTmrInt : Status Prohibit Timer interval (in ??) - * - reOrdTmr : The Reordering Timer - * - reOrdTmrInt : Re-ordering timer interval + * - reAsmblTmr : The Reordering Timer + * - reAsmblTmrInt : Re-ordering timer interval * - gatherStaPduInfo : Whether to gather information required to create * the STATUS PDU * @@ -210,8 +211,8 @@ typedef struct rlcAmUl uint16_t expSo; /**< Expected SO for reassembly */ CmTimer staProhTmr; /**< T_status_prohibit Timer */ uint16_t staProhTmrInt; /**< Timer Interval */ - CmTimer reOrdTmr; /**< T_reordering Timer */ - uint8_t reOrdTmrInt; /**< Timer Interval */ + CmTimer reAsmblTmr; /**< T_reordering Timer */ + uint8_t reAsmblTmrInt; /**< Timer Interval */ Bool gatherStaPduInfo; /**< Gather STATUS PDU creation info*/ Bool isOutOfSeq; /**< To identify whether packets are Out-Of-Seq or not */ uint8_t snLen; /*!< Sequence number length:12 bit or 18 bit : 5GNR RLC */ @@ -557,7 +558,7 @@ Void rlcAmmProcessPdus ARGS((RlcCb *gCb, KwPduInfo *pduInfo)); #endif -Void rlcAmmReOrdTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb)); +Void rlcAmmReAsmblTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb)); Void rlcAmmStaProTmrExp ARGS((RlcCb *gCb, RlcUlRbCb *rbCb)); diff --git a/src/5gnrrlc/kw_utl_dl.c b/src/5gnrrlc/kw_utl_dl.c index 52276399c..609be1fba 100755 --- a/src/5gnrrlc/kw_utl_dl.c +++ b/src/5gnrrlc/kw_utl_dl.c @@ -119,8 +119,8 @@ Void PrintRLCStats(Void) gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, gRlcStats.amRlcStats.numDLRetransPdus); DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMUL: " - " PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ", - gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, + " PdusDiscarded:%lu ReAsmblTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu ", + gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReAsmblTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd); RTLIN_DUMP_DEBUG("RLC Stats: PDUs Sent = (%ld), PdusRext = (%ld), TimeOut = (%ld), SduDiscarded = (%ld)\n", @@ -134,10 +134,10 @@ Void PrintRLCStats(Void) ulInst->genSts.errorPdusRecv); RTLIN_DUMP_DEBUG("RLC Stats:" "RLC_AMDL: StaPduSent:%lu NacksInStaPdu:%lu BytesUnused:%lu PollTimerExpires SRB:%lu DRB:%lu MaxRetx:%lu RetransPdus:%lu \n" - "RLC_AMUL: PdusDiscarded:%lu ReOrdTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu \n", + "RLC_AMUL: PdusDiscarded:%lu ReAsmblTimerExpires:%lu StaPduRcvd:%lu NackInStaPduRcvd:%lu \n", gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu, gRlcStats.amRlcStats.numDLBytesUnused, gRlcStats.amRlcStats.numDLPollTimerExpiresSrb, gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, - gRlcStats.amRlcStats.numDLRetransPdus, gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, + gRlcStats.amRlcStats.numDLRetransPdus, gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReAsmblTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd); } #else @@ -165,8 +165,8 @@ Void PrintRLCStats(Void) gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, gRlcStats.amRlcStats.numDLRetransPdus); DU_LOG("\nINFO --> RLC_DL : RLC Stats: AMUL: " - " PdusDiscarded:%u ReOrdTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u ", - gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, + " PdusDiscarded:%u ReAsmblTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u ", + gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReAsmblTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd); /* RTLIN_DUMP_DEBUG("AM RLC Stats:" "RLC_AMDL: SDUs Tx :(%u) SDU Bytes Tx :(%u) SDUs Retx :(%u) MaxRetx:(%u) WindowStalls: (%u) \n" @@ -188,14 +188,14 @@ Void PrintRLCStats(Void) RTLIN_DUMP_DEBUG("RLC_AMDL: StaPduSent:%u NacksInStaPdu:%u BytesUnused:%u PollTimerExpires SRB:%u DRB:%u MaxRetx:%u RetransPdus:%u \n" " SDUs Tx :(%u) SDU Bytes Tx :(%u) SDUs Retx :(%u) WindowStalls: (%u) \n" - "RLC_AMUL: PdusDiscarded:%u ReOrdTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u \n" + "RLC_AMUL: PdusDiscarded:%u ReAsmblTimerExpires:%u StaPduRcvd:%u NackInStaPduRcvd:%u \n" " DropOutWinRx :(%u) SDUs Rx :(%u) SDU Bytes Rx :(%u) SDUNack Rx :(%u) Duplicate Pdu Rx:(%u) \n", gRlcStats.amRlcStats.numDLStaPduSent, gRlcStats.amRlcStats.numDLNacksInStaPdu, gRlcStats.amRlcStats.numDLBytesUnused, gRlcStats.amRlcStats.numDLPollTimerExpiresSrb, gRlcStats.amRlcStats.numDLPollTimerExpiresDrb, gRlcStats.amRlcStats.numDLMaxRetx, gRlcStats.amRlcStats.numDLRetransPdus, gRlcStats.amRlcStats.numRlcAmCellSduTx, gRlcStats.amRlcStats.numRlcAmCellSduBytesTx, gRlcStats.amRlcStats.numRlcAmCellRetxPdu, gRlcStats.amRlcStats.numRlcAmCellWinStall, - gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReOrdTimerExpires, + gRlcStats.amRlcStats.numULPdusDiscarded, gRlcStats.amRlcStats.numULReAsmblTimerExpires, gRlcStats.amRlcStats.numULStaPduRcvd, gRlcStats.amRlcStats.numULNackInStaPduRcvd, gRlcStats.amRlcStats.numRlcAmCellDropOutWinRx, gRlcStats.amRlcStats.numRlcAmCellSduRx, gRlcStats.amRlcStats.numRlcAmCellSduBytesRx, gRlcStats.amRlcStats.numRlcAmCellNackRx, gRlcStats.amRlcStats.numRlcAmCellDupPduRx); diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 1b06379aa..b68e53c74 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -176,7 +176,7 @@ void fillLcCfg(RlcEntCfgInfo *rlcUeCfg, RlcBearerCfg *duRlcUeCfg, uint8_t cfgTyp 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.reOrdTmr = duRlcUeCfg->u.amCfg->ulAmCfg.reAssemTmr * RLC_REASSEMBLY_TMR_BASE; + rlcUeCfg->m.amInfo.ul.reAsmblTmr = duRlcUeCfg->u.amCfg->ulAmCfg.reAssemTmr * RLC_REASSEMBLY_TMR_BASE; break; } case RLC_MODE_UM: diff --git a/src/cm/ckw.c b/src/cm/ckw.c index fe1842dc2..8c2a930da 100755 --- a/src/cm/ckw.c +++ b/src/cm/ckw.c @@ -266,7 +266,7 @@ Buffer *mBuf { /* UP LINK */ - CMCHKPK(oduUnpackUInt8, param->ul.reOrdTmr, mBuf); + CMCHKPK(oduUnpackUInt8, param->ul.reAsmblTmr, mBuf); CMCHKPK(oduUnpackUInt16, param->ul.staProhTmr, mBuf); CMCHKPK(oduUnpackUInt8, param->ul.snLen, mBuf); @@ -896,7 +896,7 @@ Buffer *mBuf /* UP LINK */ CMCHKUNPK(oduPackUInt8, &(param->ul.snLen), mBuf); CMCHKUNPK(oduPackUInt16, &(param->ul.staProhTmr), mBuf); - CMCHKUNPK(oduPackUInt8, &(param->ul.reOrdTmr), mBuf); + CMCHKUNPK(oduPackUInt8, &(param->ul.reAsmblTmr), mBuf); return ROK; } /* cmUnpkRlcAmInfo */ diff --git a/src/cm/ckw.x b/src/cm/ckw.x index 372f0e757..6d695887d 100755 --- a/src/cm/ckw.x +++ b/src/cm/ckw.x @@ -92,7 +92,7 @@ typedef struct rlcAmInfo uint8_t snLen; /*!< Sequence Number length in bits. Allowed values are 12 and 18 */ uint16_t staProhTmr; /*!< T_status_prohibit Timer in msec*/ - uint8_t reOrdTmr; /*!< T_reordering Timer in msec*/ + uint8_t reAsmblTmr; /*!< T_reordering Timer in msec*/ }ul; /*!< Up link */ }RlcAmInfo; diff --git a/src/cm/du_app_rlc_inf.h b/src/cm/du_app_rlc_inf.h index de1f18eed..f168522ef 100644 --- a/src/cm/du_app_rlc_inf.h +++ b/src/cm/du_app_rlc_inf.h @@ -106,122 +106,6 @@ typedef enum UM_SIZE_12 }SnLenUm; -typedef enum -{ - RE_ASM_0MS, - RE_ASM_5MS, - RE_ASM_10MS, - RE_ASM_15MS, - RE_ASM_20MS, - RE_ASM_25MS, - RE_ASM_30MS, - RE_ASM_35MS, - RE_ASM_40MS, - RE_ASM_45MS, - RE_ASM_50MS, - RE_ASM_55MS, - RE_ASM_60MS, - RE_ASM_65MS, - RE_ASM_70MS, - RE_ASM_75MS, - RE_ASM_80MS, - RE_ASM_85MS, - RE_ASM_90MS, - RE_ASM_95MS, - RE_ASM_100MS, - RE_ASM_105MS, - RE_ASM_110MS, - RE_ASM_115MS, - RE_ASM_120MS, - RE_ASM_125MS, - RE_ASM_130MS, - RE_ASM_135MS, - RE_ASM_140MS, - RE_ASM_145MS, - RE_ASM_150MS, - RE_ASM_155MS, - RE_ASM_160MS, - RE_ASM_165MS, - RE_ASM_170MS, - RE_ASM_175MS, - RE_ASM_180MS, - RE_ASM_185MS, - RE_ASM_190MS, - RE_ASM_195MS, - RE_ASM_200MS, - RE_ASM_SPARE1 - -}TReAssembleTmr; - -typedef enum -{ - PROH_0MS, - PROH_5MS, - PROH_10MS, - PROH_15MS, - PROH_20MS, - PROH_25MS, - PROH_30MS, - PROH_35MS, - PROH_40MS, - PROH_45MS, - PROH_50MS, - PROH_55MS, - PROH_60MS, - PROH_65MS, - PROH_70MS, - PROH_75MS, - PROH_80MS, - PROH_85MS, - PROH_90MS, - PROH_95MS, - PROH_100MS, - PROH_105MS, - PROH_110MS, - PROH_115MS, - PROH_120MS, - PROH_125MS, - PROH_130MS, - PROH_135MS, - PROH_140MS, - PROH_145MS, - PROH_150MS, - PROH_155MS, - PROH_160MS, - PROH_165MS, - PROH_170MS, - PROH_175MS, - PROH_180MS, - PROH_185MS, - PROH_190MS, - PROH_195MS, - PROH_200MS, - PROH_205MS, - PROH_210MS, - PROH_215MS, - PROH_220MS, - PROH_225MS, - PROH_230MS, - PROH_235MS, - PROH_240MS, - PROH_245MS, - PROH_250MS, - PROH_300MS, - PROH_350MS, - PROH_400MS, - PROH_450MS, - PROH_500MS, - PROH_800MS, - PROH_1000MS, - PROH_1200MS, - PROH_1600MS, - PROH_2000MS, - PROH_2400MS, - PROH_SPARE2, - PROH_SPARE1 - -}TStatProhTmr; - typedef enum { RLC_DU_APP_RSP_NOK, @@ -231,8 +115,8 @@ typedef enum typedef struct ulAmCfg { SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */ - TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/ - TStatProhTmr statProhTmr; /* T_status_prohibit Timer in msec*/ + int8_t reAssemTmr; /* T_reassembling Timer in msec*/ + int16_t statProhTmr; /* T_status_prohibit Timer in msec*/ }UlAmCfg; @@ -255,7 +139,7 @@ typedef struct dlUmCfg typedef struct ulUmCfg { SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */ - TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/ + int8_t reAssemTmr; /* T_reassembling Timer in msec*/ }UlUmCfg; diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index f896046b8..cb0319930 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -255,8 +255,10 @@ #define POLL_BYTE_VAL -1 /* Value for infinite poll byte */ #define MAX_RETX_THRESHOLD 5 /* Enum for 8 retransmissions */ #define MAX_RETX_THRESHOLD_VAL 8 /* Value for 8 retransmissions */ -#define T_REASSEMBLY 8 -#define T_STATUS_PROHIBHIT 7 +#define T_REASSEMBLY 8 /* enum for RE_ASM_40MS */ +#define T_REASSEMBLY_VAL 40 /* default re assembly timer */ +#define T_STATUS_PROHIBHIT 7 /* enum for PROH_35MS */ +#define T_STATUS_PROHIBHIT_VAL 35 /* default status prohibit timer */ #define MAC_LC_PRIORITY 1 #define PRIORTISIED_BIT_RATE 15 #define BUCKET_SIZE_DURATION 5 diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index bd6fa0817..ff73b8e1e 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -114,6 +114,7 @@ DuCfgParams duCfgParam; * @return Actual value of pollPdu * * **********************************************************************/ + uint16_t getPollRetxTmr(uint8_t pollRetxTmrCfg) { uint16_t pollRetxTmr; @@ -461,6 +462,132 @@ uint8_t getMaxRetx(uint8_t maxRetxCfg) return maxRetx; } +/******************************************************************* + * @brief Converts enum values into actual value of reassembly timer + * + * @details + * + * Function : getReAsmblTmr + * + * Functionality: Converts enum values into actual value of reassembly + * timer + * + * @params[in] Enum value of reassembly timer + * @return Actual value of reassembly timer + * + * **********************************************************************/ + +int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg) +{ + int8_t reAsmblTmr = 0; + + if(reAsmblTmrCfg == T_Reassembly_ms0) + { + reAsmblTmr = 0; + } + else if(reAsmblTmrCfg >= T_Reassembly_ms5 || reAsmblTmrCfg <= T_Reassembly_ms100) + { + /* All values of re assembly timer are at interval of 5ms. + * This is valid upto 100ms + * Hence converting the enum value to actual value by multiplying it to 5 + */ + reAsmblTmr = reAsmblTmrCfg * 5; + } + else if(reAsmblTmrCfg >= T_Reassembly_ms110 || reAsmblTmrCfg <= T_Reassembly_ms200) + { + /* All values of re assembly timer are at interval of 10ms. + * This is valid upto 200ms + * since enum value starts from 20 for 100ms, subtracting 10 and + * converting the enum value to actual value by multiplying it to 10 + */ + reAsmblTmr = ((reAsmblTmrCfg-10) * 10); + } + else + { + DU_LOG("\nERROR --> F1AP : Invalid value of Re Assembly timer %d", reAsmblTmrCfg); + reAsmblTmr = -1; + } + return reAsmblTmr; +} + +/************************************************************************ + * + * @brief Converts enum values into actual value of status prohibit timer + * + * @details + * + * Function : getStatProhTmr + * + * Functionality: Converts enum values into actual value of status prohibit + * timer + * + * @params[in] Enum value of status prohibit timer + * @return Actual value of status prohibit timer + * + * **********************************************************************/ + +int16_t getStatProhTmr(uint8_t statProhTmrCfg) +{ + int16_t statProhTmr =0; + + if(statProhTmrCfg == T_StatusProhibit_ms0) + { + statProhTmr = 0; + } + else if(statProhTmrCfg >= T_StatusProhibit_ms5 || statProhTmrCfg <= T_StatusProhibit_ms250) + { + /* All values of re assembly timer are at interval of 5ms. + * This is valid upto 250ms + * Hence converting the enum value to actual value by multiplying it to 5 + */ + statProhTmr = statProhTmrCfg * 5; + } + else + { + switch(statProhTmrCfg) + { + case T_StatusProhibit_ms300: + statProhTmr = 300; + break; + case T_StatusProhibit_ms350: + statProhTmr = 350; + break; + case T_StatusProhibit_ms400: + statProhTmr = 400; + break; + case T_StatusProhibit_ms450: + statProhTmr = 450; + break; + case T_StatusProhibit_ms500: + statProhTmr = 500; + break; + case T_StatusProhibit_ms800: + statProhTmr = 800; + break; + case T_StatusProhibit_ms1000: + statProhTmr = 1000; + break; + case T_StatusProhibit_ms1200: + statProhTmr = 1200; + break; + case T_StatusProhibit_ms1600: + statProhTmr = 1600; + break; + case T_StatusProhibit_ms2000: + statProhTmr = 2000; + break; + case T_StatusProhibit_ms2400: + statProhTmr = 2400; + break; + default: + DU_LOG("\nInvalid value of Status Prohibit timer %d", statProhTmrCfg); + statProhTmr = -1; + break; + } + } + return statProhTmr; +} + /******************************************************************* * * @brief Builds Uplink Info for NR @@ -6688,7 +6815,8 @@ void extractRlcAmCfg(AmBearerCfg *amCfgToSet, struct RLC_Config__am *rlcAmCfg) if(rlcAmCfg->dl_AM_RLC.sn_FieldLength) { amCfgToSet->ulAmCfg.snLenUl = *(rlcAmCfg->dl_AM_RLC.sn_FieldLength); - amCfgToSet->ulAmCfg.reAssemTmr = rlcAmCfg->dl_AM_RLC.t_Reassembly; + /*TODO: Check the timer value when sent by real CU */ + amCfgToSet->ulAmCfg.reAssemTmr = rlcAmCfg->dl_AM_RLC.t_Reassembly; amCfgToSet->ulAmCfg.statProhTmr = rlcAmCfg->dl_AM_RLC.t_StatusProhibit; } diff --git a/src/du_app/du_f1ap_msg_hdl.h b/src/du_app/du_f1ap_msg_hdl.h index 1033d6020..e2b126956 100644 --- a/src/du_app/du_f1ap_msg_hdl.h +++ b/src/du_app/du_f1ap_msg_hdl.h @@ -45,6 +45,8 @@ uint8_t sctpSend(Buffer *mBuf, uint8_t itfType); uint8_t duProcDlRrcMsg(F1DlRrcMsg *dlRrcMsg); uint8_t duProcUeContextSetupRequest(DuUeCb *ueCb); void duFillModulationDetails(MacUeCfg *ueCfg, MacUeCfg *oldUeCfg, void *ueCap); +int8_t getReAsmblTmr(uint8_t reAsmblTmrCfg); +int16_t getStatProhTmr(uint8_t statProhTmrCfg); /********************************************************************** End of file diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 5fb75f910..d863ece42 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -1140,8 +1140,8 @@ void fillDefaultAmInfo(AmBearerCfg *amCfg) /* UL AM */ amCfg->ulAmCfg.snLenUl = AM_SIZE_12; - amCfg->ulAmCfg.reAssemTmr = RE_ASM_40MS; - amCfg->ulAmCfg.statProhTmr = PROH_35MS; + amCfg->ulAmCfg.reAssemTmr = T_REASSEMBLY_VAL; + amCfg->ulAmCfg.statProhTmr = T_STATUS_PROHIBHIT_VAL; } /****************************************************************** @@ -1162,7 +1162,7 @@ void fillDefaultUmBiInfo(UmBiDirBearerCfg *umBiDirCfg) { /* UL UM BI DIR INFO */ umBiDirCfg->ulUmCfg.snLenUlUm = UM_SIZE_12; - umBiDirCfg->ulUmCfg.reAssemTmr = RE_ASM_40MS; + umBiDirCfg->ulUmCfg.reAssemTmr = T_REASSEMBLY_VAL; /* DL UM BI DIR INFO */ umBiDirCfg->dlUmCfg.snLenDlUm = UM_SIZE_12; @@ -1185,7 +1185,7 @@ void fillDefaultUmBiInfo(UmBiDirBearerCfg *umBiDirCfg) void fillDefaultUmUlInfo(UmUniDirUlBearerCfg *UmUlCfg) { UmUlCfg->ulUmCfg.snLenUlUm = UM_SIZE_12; - UmUlCfg->ulUmCfg.reAssemTmr = RE_ASM_40MS; + UmUlCfg->ulUmCfg.reAssemTmr = T_REASSEMBLY_VAL; } /****************************************************************** diff --git a/src/phy_stub/phy_stub_msg_hdl.c b/src/phy_stub/phy_stub_msg_hdl.c index 176385dc6..1974165e2 100644 --- a/src/phy_stub/phy_stub_msg_hdl.c +++ b/src/phy_stub/phy_stub_msg_hdl.c @@ -1317,20 +1317,23 @@ uint8_t l1SendUlUserData() /* Filling PDU */ pdu = (uint8_t *)pduInfo->pduData; - msgLen = 51; + msgLen = 52; /* For UL User data MAC subheader format is R/F/LCId/L (2/3 bytes) LCId is 4 for DRB1 L is length of PDU i.e 50 bytes From 38.321 section 6.1.1 + From 38.322 section 6.2.2.4, 6.2.2.3 for AM, UM Header */ - uint8_t ulMsg[] = {4, msgLen, 0, 69, 0, 0, 50, 0, 0, 0, 0, 0, 1, 0, 0, 192, 168, 130, 81, 192, 168, 130, 82, 84, 104, - 105, 115, 32, 105, 115, 32, 69, 71, 84, 80, 32, 100, 97, 116, 97, 32, 102, 114, 111, 109, 32, 68, 85, 0, 0, 0, 0, 0}; - msgLen += 2; /* 2bytes of header */ - memcpy(pdu, &ulMsg, msgLen); - byteIdx += msgLen; /* 2 bytes of header */ + /* Below ulMsg supports 12bit SN for UM mode */ + /* SI SN */ + uint8_t ulMsg[] = {4, msgLen, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 1, 0, 0, 192, 168, 130, 81, 192, 168, 130, 82, 84, 104, + 105, 115, 32, 105, 115, 32, 69, 71, 84, 80, 32, 100, 97, 116, 97, 32, 102, 114, 111, 109, 32, 68, 85, 0, 0, 0, 0, 0}; + msgLen += 2; /* 2bytes of header */ + memcpy(pdu, &ulMsg, msgLen); + byteIdx += msgLen; /* 2 bytes of header */ /* Filling MAC SDU for Padding bytes*/ if(byteIdx < pduInfo->pdu_length) @@ -1350,7 +1353,7 @@ uint8_t l1SendUlUserData() fillMsgHeader(&rxDataInd->header, FAPI_RX_DATA_INDICATION, msgLen); /* Send Message to peer */ - while(cnt < 200) + while(cnt < 2) { DU_LOG("\nDEBUG --> PHY STUB : Sending UL User Data[%d] at sfn %d slot %d", cnt+1, sfnValue, slotValue); /* Sending Rx data indication to MAC */ -- 2.16.6