fd-net-device: Change time-based attribute to TimeValue type

This commit is contained in:
Tom Henderson
2020-09-28 12:37:05 -07:00
parent dd8faec88f
commit 28e93f9be6
2 changed files with 7 additions and 9 deletions

View File

@@ -62,10 +62,10 @@ DpdkNetDevice::GetTypeId (void)
.SetGroupName ("FdNetDevice")
.AddConstructor<DpdkNetDevice> ()
.AddAttribute ("TxTimeout",
"The time to wait before transmitting burst from Tx Buffer (in us).",
UintegerValue (2000),
MakeUintegerAccessor (&DpdkNetDevice::m_txTimeout),
MakeUintegerChecker<uint64_t> ())
"The time to wait before transmitting burst from Tx buffer.",
TimeValue (MicroSeconds (2000)),
MakeTimeAccessor (&DpdkNetDevice::m_txTimeout),
MakeTimeChecker ())
.AddAttribute ("MaxRxBurst",
"Size of Rx Burst.",
UintegerValue (64),
@@ -467,9 +467,7 @@ DpdkNetDevice::Write (uint8_t *buffer, size_t length)
{
// If this is a first packet in buffer, schedule a tx.
Simulator::Cancel (m_txEvent);
m_txEvent =
Simulator::Schedule ( Time ( MicroSeconds (m_txTimeout) ),
&DpdkNetDevice::HandleTx, this);
m_txEvent = Simulator::Schedule (m_txTimeout, &DpdkNetDevice::HandleTx, this);
}
return length;

View File

@@ -172,9 +172,9 @@ private:
EventId m_txEvent;
/**
* Timeout for stale packet transmission
* The time to wait before transmitting burst from Tx buffer
*/
uint64_t m_txTimeout;
Time m_txTimeout;
/**
* Size of Rx burst