X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_fcfs.c;h=93ec5c11ab0476135824aeb40836339db7624f58;hb=e96cb439cd4a7a6f55e3fab7caed978e38bd62b4;hp=edfad6659721f9fc22f35aed32b4d1a982222de3;hpb=913519063008692a8245dd502002676cf1ee9290;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_fcfs.c b/src/5gnrsch/sch_fcfs.c index edfad6659..93ec5c11a 100644 --- a/src/5gnrsch/sch_fcfs.c +++ b/src/5gnrsch/sch_fcfs.c @@ -41,6 +41,7 @@ File: sch_fcfs.c #include "du_app_mac_inf.h" #include "mac_sch_interface.h" #include "sch.h" +#include "sch_tmr.h" #include "sch_utils.h" #include "sch_fcfs.h" #ifdef NR_DRX @@ -905,8 +906,8 @@ uint8_t schFcfsScheduleUlLc(SlotTimingInfo dciTime, SlotTimingInfo puschTime, ui uint8_t ret = RFAILED; uint16_t startPrb = 0; uint32_t totDataReq = 0; /* in bytes */ - SchUeCb *ueCb; - SchPuschInfo *puschInfo; + SchUeCb *ueCb = NULLP; + SchPuschInfo *puschInfo = NULLP; DciInfo *dciInfo = NULLP; cell = (*hqP)->hqEnt->cell; @@ -935,16 +936,15 @@ uint8_t schFcfsScheduleUlLc(SlotTimingInfo dciTime, SlotTimingInfo puschTime, ui /* Update PUSCH allocation */ if(schFillPuschAlloc(ueCb, puschTime, totDataReq, startSymb, symbLen, startPrb, isRetx, *hqP) == ROK) { - if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo) + if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId]) { - puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo; + puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId]; if(puschInfo != NULLP) { /* Fill DCI for UL grant */ schFillUlDci(ueCb, puschInfo, dciInfo, isRetx, *hqP); ueCb->srRcvd = false; ueCb->bsrRcvd = false; - cell->schUlSlotInfo[puschTime.slot]->puschUe = ueCb->ueId; if(fcfsHqProcCb->lcCb.dedLcList.count != 0) updateBsrAndLcList(&(fcfsHqProcCb->lcCb.dedLcList), ueCb->bsrInfo, ROK); updateBsrAndLcList(&(fcfsHqProcCb->lcCb.defLcList), ueCb->bsrInfo, ROK); @@ -1152,18 +1152,25 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) SchUlHqProcCb *ulHqP = NULLP; CmLList *pendingUeNode; CmLList *node; - uint8_t ueId; + uint8_t ueId, ueCount = 0; bool isRarPending = false, isRarScheduled = false; bool isMsg4Pending = false, isMsg4Scheduled = false; bool isDlMsgPending = false, isDlMsgScheduled = false; bool isUlGrantPending = false, isUlGrantScheduled = false; fcfsCell = (SchFcfsCellCb *)cell->schSpcCell; - + /* Select first UE in the linked list to be scheduled next */ pendingUeNode = fcfsCell->ueToBeScheduled.first; - if(pendingUeNode) + ueCount = fcfsCell->ueToBeScheduled.count; + + while(pendingUeNode && ueCount > 0) { + /*Since Multi-UE perTTI is not supported, re-init following parameters.*/ + isRarPending = false; isRarScheduled = false; + isMsg4Pending = false; isMsg4Scheduled = false; + isDlMsgPending = false; isDlMsgScheduled = false; + isUlGrantPending = false; isUlGrantScheduled = false; if(pendingUeNode->node) { ueId = *(uint8_t *)(pendingUeNode->node); @@ -1266,12 +1273,23 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_DL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaDl + SCHED_DELTA); #endif } } } - + } +#ifdef NR_DRX + if((cell->ueCb[ueId-1].ueDrxInfoPres == true) && (cell->ueCb[ueId-1].drxUeCb.drxUlUeActiveStatus != true)) + { + if(pendingUeNode->node) + { + cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode)); + } + } + else +#endif + { /* Scheduling of UL grant */ node = NULLP; if(fcfsUeCb) @@ -1301,26 +1319,38 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_UL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaUl + SCHED_DELTA); #endif } } } - if(!isUlGrantPending && !isDlMsgPending) + if(isUlGrantPending || isDlMsgPending) { - /* No action required */ - } - else if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled)) - { - cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode)); - } - else - { - schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled)) + { + cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode)); + } + else + { + schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + } } } } + if(!isUlGrantPending && !isDlMsgPending && !isRarPending && !isMsg4Pending) + { + DU_LOG("\nERROR --> SCH: In SchFcfsScheduleSlot, UE:%d is wrongly queued\ + in Pending UE List without any actions, Removing the UE from the list",ueId); + schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + } + if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB) + { + DU_LOG("\nINFO --> SCH: No PRB available to proceed with next UE"); + return; + } + pendingUeNode = fcfsCell->ueToBeScheduled.first; + ueCount--; } }