X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_fcfs.c;h=28cc528a30992f71dd749cb8eec04cd4ca4c35b6;hb=refs%2Fchanges%2F98%2F12298%2F1;hp=edfad6659721f9fc22f35aed32b4d1a982222de3;hpb=ec8c7f10edacea2db18e2c0726e66169cd788d4a;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_fcfs.c b/src/5gnrsch/sch_fcfs.c index edfad6659..28cc528a3 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 @@ -1157,12 +1158,13 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) bool isMsg4Pending = false, isMsg4Scheduled = false; bool isDlMsgPending = false, isDlMsgScheduled = false; bool isUlGrantPending = false, isUlGrantScheduled = false; + bool isNodeFreed = false; fcfsCell = (SchFcfsCellCb *)cell->schSpcCell; /* Select first UE in the linked list to be scheduled next */ pendingUeNode = fcfsCell->ueToBeScheduled.first; - if(pendingUeNode) + while(pendingUeNode) { if(pendingUeNode->node) { @@ -1214,6 +1216,7 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) if(isRarScheduled || isMsg4Scheduled) { schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + isNodeFreed = true; } /* If RAR/MSG4 is pending but couldnt be scheduled then, * put this UE at the end of linked list to be scheduled later */ @@ -1318,9 +1321,23 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) else { schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + isNodeFreed = true; } } } + if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB) + { + DU_LOG("\nINFO --> SCH: No PRB available to proceed with next UE"); + return; + } + if(isNodeFreed == false) + { + pendingUeNode= pendingUeNode->next; + } + else + { + pendingUeNode = fcfsCell->ueToBeScheduled.first; + } } }