Bug-fix in RrFfMacScheduler::DoSchedDlTriggerReq when scheduling multiple LCs per UE

This commit is contained in:
Marco Miozzo
2011-11-10 17:46:15 +01:00
parent 089cdd23ec
commit ed6a08165b
2 changed files with 16 additions and 7 deletions

View File

@@ -315,7 +315,7 @@ RrFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::Sch
{
NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
// API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
std::vector<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
bool newLc = true;
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
{
@@ -368,20 +368,27 @@ RrFfMacScheduler::GetRbgSize (int dlbandwidth)
return (-1);
}
bool
RrFfMacScheduler::SortRlcBufferReq (FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i,FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j)
{
return (i.m_rnti<j.m_rnti);
}
void
RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params)
{
NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf));
// API generated by RLC for triggering the scheduling of a DL subframe
// Get the actual active flows (queue!=0)
std::vector<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
m_rlcBufferReq.sort (SortRlcBufferReq);
int nflows = 0;
std::map <uint16_t,uint8_t> lcActivesPerRnti;
std::map <uint16_t,uint8_t>::iterator itLcRnti;
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
{
// NS_LOG_INFO (this << " User " << (*it).m_rnti << " LC " << (uint16_t)(*it).m_logicalChannelIdentity);
// remove old entries of this UE-LC
if ( ((*it).m_rlcTransmissionQueueSize > 0)
|| ((*it).m_rlcRetransmissionQueueSize > 0)
@@ -407,7 +414,7 @@ RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sched
}
}
}
if (nflows == 0)
{
return;
@@ -483,13 +490,13 @@ RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sched
std::vector <struct RlcPduListElement_s> newRlcPduLe;
int totRbg = lcNum * rbgPerFlow;
int tbSize = (LteAmc::GetTbSizeFromMcs (newDci.m_mcs.at (0), totRbg * rbgSize) / 8);
// NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " PRBs " << totRbg * rbgSize << " mcs " << (uint16_t) newDci.m_mcs.at (0));
NS_LOG_DEBUG (this << "Allocate user " << newEl.m_rnti << " LCs " << (uint16_t)(*itLcRnti).second << " bytes " << tbSize << " PRBs " << totRbg * rbgSize << " mcs " << (uint16_t) newDci.m_mcs.at (0));
uint16_t rlcPduSize = tbSize / lcNum;
for (int i = 0; i < lcNum ; i++)
{
RlcPduListElement_s newRlcEl;
newRlcEl.m_logicalChannelIdentity = (*it).m_logicalChannelIdentity;
//NS_LOG_DEBUG (this << "LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << rlcPduSize);
NS_LOG_DEBUG (this << "LCID " << (uint32_t) newRlcEl.m_logicalChannelIdentity << " size " << rlcPduSize << " ID " << (*it).m_rnti);
newRlcEl.m_size = rlcPduSize;
newRlcPduLe.push_back (newRlcEl);
it++;

View File

@@ -118,11 +118,13 @@ private:
int GetRbgSize (int dlbandwidth);
static bool SortRlcBufferReq (FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i,FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j);
/*
* Vectors of UE's RLC info
*/
std::vector <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
std::list <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
/*
* Map of UE's DL CQI P01 received