Introduce sanity checks on DoSchedUlTriggerReq of RR and PF schedulers

This commit is contained in:
Marco Miozzo
2012-11-08 16:51:47 +01:00
parent 5409383519
commit 38c7bd4375
2 changed files with 14 additions and 4 deletions

View File

@@ -1362,7 +1362,7 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
}
continue;
}
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth)
if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
{
// limit to physical resources last resource assignment
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
@@ -1372,7 +1372,7 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
uldci.m_rnti = (*it).first;
uldci.m_rbLen = rbPerFlow;
bool allocated = false;
while ((!allocated)&&(rbAllocated < m_cschedCellConfig.m_ulBandwidth))
while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth))
{
// check availability
bool free = true;
@@ -1399,6 +1399,11 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
break;
}
rbAllocated++;
if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
{
// limit to physical resources last resource assignment
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
}
}
if (!allocated)
{

View File

@@ -1205,7 +1205,7 @@ RrFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
}
continue;
}
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth)
if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
{
// limit to physical resources last resource assignment
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
@@ -1215,7 +1215,7 @@ RrFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
uldci.m_rnti = (*it).first;
uldci.m_rbLen = rbPerFlow;
bool allocated = false;
while ((!allocated)&&(rbAllocated < m_cschedCellConfig.m_ulBandwidth))
while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth))
{
// check availability
bool free = true;
@@ -1243,6 +1243,11 @@ RrFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
break;
}
rbAllocated++;
if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
{
// limit to physical resources last resource assignment
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
}
}
if (!allocated)
{