X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_tmr.c;h=2f3a1873228684b411e3b171971b4d80cf56aa1a;hb=f73456bd55152c329601f8286ae67fe9875025bc;hp=bd7ccfea595706a4ba1898c208ad5317bac1e4e3;hpb=1e3256d5495c8ff96506ce6f6cf60d2a500bafec;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_tmr.c b/src/5gnrrlc/rlc_tmr.c index bd7ccfea5..2f3a18732 100755 --- a/src/5gnrrlc/rlc_tmr.c +++ b/src/5gnrrlc/rlc_tmr.c @@ -60,31 +60,10 @@ * @brief RLC Timer Module */ -/** - * @def RLC_TMR_CALCUATE_WAIT - * - * This macro calculates and assigns wait time based on the value of the - * timer and the timer resolution. Timer value of 0 signifies that the - * timer is not configured - * - * @param[out] _wait Time for which to arm the timer changed to proper - * value according to the resolution - * @param[in] _tmrVal Value of the timer - * @param[in] _timerRes Resolution of the timer - * -*/ -#define RLC_TMR_CALCUATE_WAIT(_wait, _tmrVal, _timerRes) \ -{ \ - (_wait) = ((_tmrVal) * SS_TICKS_SEC)/((_timerRes) * 1000); \ - if((0 != (_tmrVal)) && (0 == (_wait))) \ - { \ - (_wait) = 1; \ - } \ -} - /* private function declarations */ static Void rlcBndTmrExpiry(PTR cb); + /** * @brief Handler to start timer * @@ -112,7 +91,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { RlcUmUl* umUl = &(((RlcUlRbCb *)cb)->m.umUl); /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, umUl->reAsmblTmrInt, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, umUl->reAsmblTmrInt, gCb->genCfg.timeRes); arg.timers = &umUl->reAsmblTmr; arg.max = RLC_MAX_UM_TMR; @@ -122,7 +101,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { RlcAmUl* amUl = &(((RlcUlRbCb *)cb)->m.amUl); /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, amUl->reAsmblTmrInt, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, amUl->reAsmblTmrInt, gCb->genCfg.timeRes); arg.timers = &amUl->reAsmblTmr; arg.max = RLC_MAX_AM_TMR; @@ -132,7 +111,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { RlcAmUl* amUl = &(((RlcUlRbCb *)cb)->m.amUl); /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, + TMR_CALCUATE_WAIT(arg.wait, amUl->staProhTmrInt, gCb->genCfg.timeRes); @@ -144,7 +123,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { RlcAmDl* amDl = &(((RlcDlRbCb *)cb)->m.amDl); /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, + TMR_CALCUATE_WAIT(arg.wait, amDl->pollRetxTmrInt, gCb->genCfg.timeRes); @@ -156,7 +135,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { RlcRguSapCb* rguSap = (RlcRguSapCb *)cb; /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, rguSap->bndTmrInt, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, rguSap->bndTmrInt, gCb->genCfg.timeRes); arg.timers = &rguSap->bndTmr; arg.max = RLC_MAX_RGUSAP_TMR; @@ -168,7 +147,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { measEvtCb = (RlcL2MeasEvtCb *)cb; /* kw005.201 Changed wait calculation ccpu00117634*/ - RLC_TMR_CALCUATE_WAIT(arg.wait, + TMR_CALCUATE_WAIT(arg.wait, measEvtCb->l2TmrCfg.val, gCb->genCfg.timeRes); @@ -177,22 +156,30 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) break; } #endif - case EVENT_RLC_THROUGHPUT_TMR: + case EVENT_RLC_UE_THROUGHPUT_TMR: { RlcThpt *thptCb = (RlcThpt *)cb; - RLC_TMR_CALCUATE_WAIT(arg.wait, ODU_THROUGHPUT_PRINT_TIME_INTERVAL, gCb->genCfg.timeRes); - arg.timers = &thptCb->thptTmr; + TMR_CALCUATE_WAIT(arg.wait, ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL, gCb->genCfg.timeRes); + arg.timers = &thptCb->ueTputInfo.ueThptTmr; arg.max = RLC_MAX_THPT_TMR; break; } case EVENT_RLC_UE_DELETE_TMR: { RlcUlUeCb *ulUeCb = (RlcUlUeCb*)cb; - RLC_TMR_CALCUATE_WAIT(arg.wait, RLC_UE_DELETE_WAIT_TIME, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, RLC_UE_DELETE_WAIT_TIME, gCb->genCfg.timeRes); arg.timers = &ulUeCb->ueDeleteInfo.ueDelTmr; arg.max = RLC_MAX_UE_TMR; break; } + case EVENT_RLC_SNSSAI_THROUGHPUT_TMR: + { + RlcThpt *thptCb = (RlcThpt *)cb; + TMR_CALCUATE_WAIT(arg.wait, ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL, gCb->genCfg.timeRes); + arg.timers = &thptCb->snssaiTputInfo.snssaiThptTmr; + arg.max = RLC_MAX_THPT_TMR; + break; + } default: { DU_LOG("\nERROR --> RLC : rlcStartTmr: Invalid tmr Evnt [%d]", tmrEvnt); @@ -275,19 +262,28 @@ void rlcStopTmr(RlcCb *gCb, PTR cb, uint8_t tmrType) break; } #endif - case EVENT_RLC_THROUGHPUT_TMR: + case EVENT_RLC_UE_THROUGHPUT_TMR: { - arg.timers = &((RlcThpt *)cb)->thptTmr; + arg.timers = &((RlcThpt *)cb)->ueTputInfo.ueThptTmr; arg.max = RLC_MAX_THPT_TMR; + break; } case EVENT_RLC_UE_DELETE_TMR: { arg.timers = &((RlcUlUeCb*)cb)->ueDeleteInfo.ueDelTmr; arg.max = EVENT_RLC_UE_DELETE_TMR; + break; + } + case EVENT_RLC_SNSSAI_THROUGHPUT_TMR: + { + arg.timers = &((RlcThpt *)cb)->snssaiTputInfo.snssaiThptTmr; + arg.max = RLC_MAX_THPT_TMR; + break; } default: { DU_LOG("\nERROR --> RLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType); + break; } } if (tmrType != TMR0) @@ -358,9 +354,9 @@ Void rlcTmrExpiry(PTR cb,S16 tmrEvnt) rlcBndTmrExpiry(cb); break; } - case EVENT_RLC_THROUGHPUT_TMR: + case EVENT_RLC_UE_THROUGHPUT_TMR: { - rlcThptTmrExpiry(cb); + rlcUeThptTmrExpiry(cb); break; } case EVENT_RLC_UE_DELETE_TMR: @@ -368,6 +364,11 @@ Void rlcTmrExpiry(PTR cb,S16 tmrEvnt) rlcUeDeleteTmrExpiry(cb); break; } + case EVENT_RLC_SNSSAI_THROUGHPUT_TMR: + { + rlcSnssaiThptTmrExpiry(cb); + break; + } default: { break; @@ -417,14 +418,18 @@ bool rlcChkTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) { return (((RlcRguSapCb *)cb)->bndTmr.tmrEvnt == EVENT_RLC_WAIT_BNDCFM); } - case EVENT_RLC_THROUGHPUT_TMR: + case EVENT_RLC_UE_THROUGHPUT_TMR: { - return (((RlcThpt *)cb)->thptTmr.tmrEvnt == EVENT_RLC_THROUGHPUT_TMR); + return (((RlcThpt *)cb)->ueTputInfo.ueThptTmr.tmrEvnt == EVENT_RLC_UE_THROUGHPUT_TMR); } case EVENT_RLC_UE_DELETE_TMR: { return (((RlcUlUeCb *)cb)->ueDeleteInfo.ueDelTmr.tmrEvnt == EVENT_RLC_UE_DELETE_TMR); } + case EVENT_RLC_SNSSAI_THROUGHPUT_TMR: + { + return (((RlcThpt *)cb)->snssaiTputInfo.snssaiThptTmr.tmrEvnt == EVENT_RLC_SNSSAI_THROUGHPUT_TMR); + } default: { DU_LOG("\nERROR --> RLC : rlcChkTmr: Invalid tmr Evnt [%d]", tmrEvnt); @@ -494,16 +499,16 @@ static Void rlcBndTmrExpiry(PTR cb) } /** - * @brief Handler to do processing on expiry of the throughput timer + * @brief Handler to do processing on expiry of UE throughput timer * * @details - * This function processes the RLC throughput timer expiry. + * This function processes the RLC UE throughput timer expiry. * * @param[in] cb Pointer to the RLC throughput struct * * @return Void */ -void rlcThptTmrExpiry(PTR cb) +void rlcUeThptTmrExpiry(PTR cb) { uint16_t ueIdx; long double tpt; @@ -513,18 +518,18 @@ void rlcThptTmrExpiry(PTR cb) if(gCellStatus != CELL_UP) { /* Restart timer */ - rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_THROUGHPUT_TMR); + rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_UE_THROUGHPUT_TMR); return; } /* If cell is up, print throughout for each UE attached to the cell */ - DU_LOG("\n===================== DL Throughput =============================="); - DU_LOG("\nNumber of UEs : %d", rlcThptCb->numActvUe); - if(rlcThptCb->numActvUe) + DU_LOG("\n===================== DL Throughput Per UE=============================="); + DU_LOG("\nNumber of UEs : %d", rlcThptCb->ueTputInfo.numActvUe); + if(rlcThptCb->ueTputInfo.numActvUe) { for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++) { - if(rlcThptCb->thptPerUe[ueIdx].ueId) + if(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].ueId) { /* Spec 28.552, section 5.1.1.3 : * Throughput in kilobits/sec = (dataVol in kiloBits * 1000)/time in milligseconds @@ -532,21 +537,69 @@ void rlcThptTmrExpiry(PTR cb) * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e. * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms */ - tpt = (double)(rlcThptCb->thptPerUe[ueIdx].dataVol * 8)/(double)ODU_THROUGHPUT_PRINT_TIME_INTERVAL; + tpt = (double)(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol * 8)/(double)ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL; - DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->thptPerUe[ueIdx].ueId, tpt); - rlcThptCb->thptPerUe[ueIdx].dataVol = 0; + DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->ueTputInfo.thptPerUe[ueIdx].ueId, tpt); + rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol = 0; } } } DU_LOG("\n=================================================================="); /* Restart timer */ - rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_THROUGHPUT_TMR); + rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_UE_THROUGHPUT_TMR); return; } +/** + * @brief Handler to do processing on expiry of the SNSSAI throughput timer + * + * @details + * This function processes the RLC SNSSAI throughput timer expiry. + * + * @param[in] cb Pointer to the RLC throughput struct + * + * @return Void + */ +void rlcSnssaiThptTmrExpiry(PTR cb) +{ + RlcThpt *rlcThptCb = (RlcThpt*)cb; + + static uint8_t snssaiCntDl = 0, snssaiCntUl = 0; + /*Bit map to keep record of reception of DL and UL Snssai Tput expiry*/ + static uint8_t snssaiTputBitmap = DIR_NONE; + + /* If cell is not up, throughput details cannot be printed */ + if(gCellStatus != CELL_UP) + { + /* Restart timer */ + rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_SNSSAI_THROUGHPUT_TMR); + return; + } + + if(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList != NULLP) + { + snssaiCntDl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList, DIR_DL); + snssaiTputBitmap |= DIR_DL; + arrTputPerSnssai[DIR_DL] = rlcThptCb->snssaiTputInfo.dlTputPerSnssaiList; + } + if(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList != NULLP) + { + snssaiCntUl = rlcCalculateTputPerSnssai(rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList, DIR_UL); + snssaiTputBitmap |= DIR_UL; + arrTputPerSnssai[DIR_UL] = rlcThptCb->snssaiTputInfo.ulTputPerSnssaiList; + } + if(snssaiTputBitmap == DIR_BOTH) + { + //call the function + BuildSliceReportToDu(MAX(snssaiCntUl, snssaiCntDl)); + snssaiTputBitmap = DIR_NONE; + } + /* Restart timer */ + rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)rlcThptCb, EVENT_RLC_SNSSAI_THROUGHPUT_TMR); + return; +} /** * * @brief filling RLC UE delete configuration @@ -608,7 +661,7 @@ uint8_t rlcUeDeleteTmrExpiry(PTR cb) if(RlcProcCfgReq(&ueCb->ueDeleteInfo.pst, rlcUeCfg) != ROK) { DU_LOG("\nERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to delete UE"); - if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, INVALID_UEID) != ROK) + if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, UEID_INVALID) != ROK) { DU_LOG("ERROR --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response "); return RFAILED;