diff -r 89144bf66a0e src/devices/emu/emu-net-device.cc --- a/src/devices/emu/emu-net-device.cc Wed Jun 16 13:45:49 2010 +0100 +++ b/src/devices/emu/emu-net-device.cc Thu Jun 24 18:47:05 2010 +0100 @@ -57,7 +57,6 @@ NS_OBJECT_ENSURE_REGISTERED (EmuNetDevice); #define EMU_MAGIC 65867 -#define MAX_PENDING_READS 8 TypeId @@ -109,6 +108,14 @@ MakePointerAccessor (&EmuNetDevice::m_queue), MakePointerChecker ()) + .AddAttribute ("RxQueueSize", "Maximum size of the read queue. " + "This value limits number of packets that have been read " + "from the network into a memory buffer but have not yet " + "been processed by the simulator.", + UintegerValue (1000), + MakeUintegerAccessor (&EmuNetDevice::m_maxPendingReads), + MakeUintegerChecker ()) + // // Trace sources at the "top" of the net device, where packets transition // to/from higher layers. These points do not really correspond to the @@ -772,7 +779,7 @@ { CriticalSection cs (m_pendingReadMutex); //std::cerr << std::endl << "EmuNetDevice read thread: m_pendingReadCount is " << m_pendingReadCount << std::endl; - if (m_pendingReadCount >= MAX_PENDING_READS) + if (m_pendingReadCount >= m_maxPendingReads) { skip = true; } diff -r 89144bf66a0e src/devices/emu/emu-net-device.h --- a/src/devices/emu/emu-net-device.h Wed Jun 16 13:45:49 2010 +0100 +++ b/src/devices/emu/emu-net-device.h Thu Jun 24 18:47:05 2010 +0100 @@ -522,6 +522,7 @@ */ uint32_t m_nodeId; + uint32_t m_maxPendingReads; uint32_t m_pendingReadCount; SystemMutex m_pendingReadMutex; };