X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_upr_inf_mgr.c;h=a717adf6a612738ef91f8fb5f5ad32335c8db3d0;hb=f3ebe72b954b0880bd8a5ddeef806ca29e87af32;hp=fba7a5614feb003a437c21ab4569290cc6a65f35;hpb=154ac5a3676b120c741184f7e58627df8003b5c0;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_upr_inf_mgr.c b/src/5gnrrlc/rlc_upr_inf_mgr.c index fba7a5614..a717adf6a 100755 --- a/src/5gnrrlc/rlc_upr_inf_mgr.c +++ b/src/5gnrrlc/rlc_upr_inf_mgr.c @@ -832,29 +832,60 @@ KwuDiscSduInfo *discSdu * -# Snssai Node * */ -RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiActionType action) +RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, ActionTypeLL action, Direction dir) { CmLListCp *snssaiList = NULLP; CmLList *node = NULLP; RlcTptPerSnssai *snssaiNode = NULLP; bool found = FALSE; - snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList; - if(snssaiList == NULLP) + if(dir == DIR_DL) { + snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList; if(action == CREATE) { - RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList, sizeof(CmLListCp)); - snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList; - cmLListInit(snssaiList); - DU_LOG("\nINFO --> RLC: First SNSSAI to add in this List"); + if(snssaiList == NULLP) + { + RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList, sizeof(CmLListCp)); + snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList; + cmLListInit(snssaiList); + } } else { - DU_LOG("\nERROR --> RLC: SNSSAI list doesnt exist!"); - return NULLP; + if(snssaiList == NULLP) + { + DU_LOG("\nERROR --> RLC: SNSSAI DL list doesnt exist!"); + return NULLP; + } } } + else if(dir == DIR_UL) + { + snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList; + if(action == CREATE) + { + if(snssaiList == NULLP) + { + RLC_ALLOC(gCb, gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList, sizeof(CmLListCp)); + snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList; + cmLListInit(snssaiList); + } + } + else + { + if(snssaiList == NULLP) + { + DU_LOG("\nERROR --> RLC: SNSSAI UL list doesnt exist!"); + return NULLP; + } + } + } + else + { + DU_LOG("\nERROR --> RLC : Direction:%d is invalid", dir); + return NULLP; + } node = snssaiList->first; @@ -864,7 +895,7 @@ RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiAc snssaiNode = (RlcTptPerSnssai *)node->node; if(memcmp(snssaiNode->snssai, snssai, sizeof(Snssai)) == 0) { - DU_LOG("\nDEBUG --> RLC : SNSSAI found in LL"); + DU_LOG("\nDEBUG --> RLC : SNSSAI found in LL"); found = TRUE; break; } @@ -944,6 +975,16 @@ RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiAc } return NULLP; } + case PRINT: + case TRAVERSE_ALL: + { + break; + } + default: + { + DU_LOG("\nERROR -> RLC: Incorrect ActionType:%d",action); + break; + } } return (snssaiNode); } @@ -958,20 +999,31 @@ RlcTptPerSnssai* rlcHandleSnssaiTputlist(RlcCb *gCb, Snssai *snssai, RlcSnssaiAc * * @param[in] gCb RlcCb * - * @return void + * @return uint_8 (ROK/RFAILED) * */ -void rlcDelTputSnssaiList(RlcCb *gCb) +uint8_t rlcDelTputSnssaiList(RlcCb *gCb, Direction dir) { CmLListCp *snssaiList = NULLP; CmLList *node = NULLP, *next = NULLP; RlcTptPerSnssai *snssaiNode = NULLP; - - snssaiList = gCb->rlcThpt.snssaiTputInfo.tputPerSnssaiList; + if(dir == DIR_DL) + { + snssaiList = gCb->rlcThpt.snssaiTputInfo.dlTputPerSnssaiList; + } + else if(dir == DIR_UL) + { + snssaiList = gCb->rlcThpt.snssaiTputInfo.ulTputPerSnssaiList; + } + else + { + DU_LOG("\nERROR --> RLC: Invalid direction:%d",dir); + return RFAILED; + } if(snssaiList == NULLP) { - DU_LOG("\nERROR --> RLC: SnssaiList not exist"); - return; + DU_LOG("\nERROR --> RLC: SnssaiList not exist"); + return RFAILED; } node = snssaiList->first; @@ -988,8 +1040,9 @@ void rlcDelTputSnssaiList(RlcCb *gCb) if(snssaiList->count == 0) { RLC_FREE(gCb, snssaiList, sizeof(CmLListCp)); - DU_LOG("\nINFO --> RLC : This SNSSAI was last in the list thus freeing the list also"); + DU_LOG("\nDEBUG --> RLC : This SNSSAI was last in the list thus freeing the list also"); } + return ROK; } /** @@ -1005,30 +1058,42 @@ void rlcDelTputSnssaiList(RlcCb *gCb) * @return void * */ -void rlcCalculateTputPerSnssai(CmLListCp *snssaiList) +uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir) { CmLList *node = NULLP; RlcTptPerSnssai *snssaiNode = NULLP; - double long tpt = 0; + uint8_t snssaiCnt = 0; node = snssaiList->first; if(node == NULLP) { DU_LOG("\n No SNSSAI in list"); - return; + return(snssaiCnt); } /*Traversing the LC LinkList*/ while(node) { snssaiNode = (RlcTptPerSnssai *)node->node; - tpt = (double)(snssaiNode->dataVol * 8)/(double)ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL; - DU_LOG("\nSNSSAI(sst:%d,sd [%d,%d, %d]), DL Tpt : %.2Lf", snssaiNode->snssai->sst, snssaiNode->snssai->sd[0], \ - snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , tpt); + snssaiNode->tpt = (double)(snssaiNode->dataVol * 8)/(double)(ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL * 0.001); + + if(dir == DIR_DL) + { + DU_LOG("\nDEBUG --> RLC_DL: SNSSAI(sst:%d,sd [%d,%d, %d]), DL Tpt : %.5lf", snssaiNode->snssai->sst,\ + snssaiNode->snssai->sd[0], snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , snssaiNode->tpt); + } + if(dir == DIR_UL) + { + DU_LOG("\nDEBUG --> RLC_UL: SNSSAI(sst:%d,sd [%d,%d, %d]), UL Tpt : %.5lf", snssaiNode->snssai->sst,\ + snssaiNode->snssai->sd[0], snssaiNode->snssai->sd[1],snssaiNode->snssai->sd[2] , snssaiNode->tpt); + } + snssaiNode->dataVol = 0; node = node->next; + snssaiCnt++; } - return; + return(snssaiCnt); } + /********************************************************************30** End of file **********************************************************************/