Update RR and PF scheduler for updating BSR queues avoiding overflows

This commit is contained in:
Marco Miozzo
2011-12-22 17:59:01 +01:00
parent 6763a50f29
commit fa0ccf1951
2 changed files with 19 additions and 3 deletions

View File

@@ -1181,7 +1181,14 @@ PfFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
if (it!=m_ceBsrRxed.end ())
{
// NS_LOG_DEBUG (this << " UE " << rnti << " size " << size << " BSR " << (*it).second);
(*it).second -= size;
if ((*it).second >= size)
{
(*it).second -= size;
}
else
{
(*it).second = 0;
}
}
else
{

View File

@@ -23,6 +23,7 @@
#include "lte-amc.h"
#include "rr-ff-mac-scheduler.h"
#include <ns3/simulator.h>
NS_LOG_COMPONENT_DEFINE ("RrFfMacScheduler");
@@ -816,6 +817,7 @@ RrFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::S
{
// update the CQI value
(*it).second = BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0));
// NS_LOG_DEBUG (this << " Update BSR with " << BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0)) << " at " << Simulator::Now ());
}
}
}
@@ -1010,8 +1012,15 @@ RrFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size)
std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti);
if (it!=m_ceBsrRxed.end ())
{
// NS_LOG_DEBUG (this << " UE " << rnti << " szie " << size << " BSR " << (*it).second);
(*it).second -= size;
// NS_LOG_DEBUG (this << " Update RLC BSR UE " << rnti << " size " << size << " BSR " << (*it).second);
if ((*it).second >= size)
{
(*it).second -= size;
}
else
{
(*it).second = 0;
}
}
else
{