Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed unnecessary checking of m_iswait
  • Loading branch information
piyushnh committed Jun 6, 2019
commit f61bcdbff74b13be43ddbd7f8ca7deb39a29bf96
44 changes: 16 additions & 28 deletions src/traffic-control/model/red-queue-disc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,39 +682,27 @@ double
RedQueueDisc::ModifyP (double p, uint32_t size)
{
NS_LOG_FUNCTION (this << p << size);
double count1 = (double) m_count;
double count = (double) m_count;

if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
{
count1 = (double) (m_countBytes / m_meanPktSize);
count = (double) (m_countBytes / m_meanPktSize);
}

if (m_isWait)
{
if (count1 * p < 1.0)
{
p = 0.0;
}
else if (count1 * p < 2.0)
{
p /= (2.0 - count1 * p);
}
else
{
p = 1.0;
}
}
else
{
if (count1 * p < 1.0)
{
p /= (1.0 - count1 * p);
}
else
{
p = 1.0;
}
}

if (count * p < 1.0)
{
p = 0.0;
}
else if (count * p < 2.0)
{
p /= (2.0 - count * p);
}
else
{
p = 1.0;
}


if ((GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES) && (p < 1.0))
{
Expand Down