X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_fcfs.c;h=e949f3b10a607693d009de85d8f0fb920df3a7da;hb=refs%2Fchanges%2F73%2F12373%2F3;hp=28cc528a30992f71dd749cb8eec04cd4ca4c35b6;hpb=324bffe05ee2a2a3754150dea9c17dc5cb06565b;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_fcfs.c b/src/5gnrsch/sch_fcfs.c index 28cc528a3..e949f3b10 100644 --- a/src/5gnrsch/sch_fcfs.c +++ b/src/5gnrsch/sch_fcfs.c @@ -1153,19 +1153,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; - bool isNodeFreed = false; fcfsCell = (SchFcfsCellCb *)cell->schSpcCell; - + /* Select first UE in the linked list to be scheduled next */ pendingUeNode = fcfsCell->ueToBeScheduled.first; - while(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); @@ -1216,7 +1222,6 @@ 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 */ @@ -1310,34 +1315,32 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) } } - if(!isUlGrantPending && !isDlMsgPending) - { - /* No action required */ - } - else if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled)) + if(isUlGrantPending || isDlMsgPending) { - cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode)); - } - else - { - schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); - isNodeFreed = true; + if((isUlGrantPending && !isUlGrantScheduled) || (isDlMsgPending && !isDlMsgScheduled)) + { + cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode)); + } + else + { + schFcfsRemoveUeFrmScheduleLst(cell, pendingUeNode); + } } } } - if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB) + if(!isUlGrantPending && !isDlMsgPending && !isRarPending && !isMsg4Pending) { - DU_LOG("\nINFO --> SCH: No PRB available to proceed with next UE"); - return; + 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(isNodeFreed == false) - { - pendingUeNode= pendingUeNode->next; - } - else + if(cell->schDlSlotInfo[slotInd->slot]->prbAlloc.numPrbAlloc >= MAX_NUM_RB) { - pendingUeNode = fcfsCell->ueToBeScheduled.first; + DU_LOG("\nINFO --> SCH: No PRB available to proceed with next UE"); + return; } + pendingUeNode = fcfsCell->ueToBeScheduled.first; + ueCount--; } }