Bugzilla – Bug 2384
Child queue discs need to notify their parent queue disc of packet drops
Last modified: 2016-05-11 06:26:48 UTC
Created attachment 2396 [details] Proposed fix Otherwise the packet/byte counters kept by the parent queue disc are incorrect, as they are updated when a packet is enqueued or dequeued but not when a packet is dropped by a child queue disc. In order to avoid introducing a reference cycle, I could not add a Ptr<QueueDisc> m_parent method in the QueueDisc class and used a callback. This issue has been discovered while implementing fq-codel (for which a code review is basically ready), which checks that the number of packets enqueued in the whole queue disc does not exceed a given limit. Thanks, Stefano
Created attachment 2401 [details] Proposed fix v2 Second version of the proposed fix, which differs from the previous one in that the signature of void QueueDisc::Drop (Ptr<QueueDiscItem> item); is changed into void QueueDisc::Drop (Ptr<QueueItem> item); This is to allow queues to notify queue discs of packet drops (see bug #2389) through a callback set to QueueDisc::Drop. This is safe because QueueDiscItem inherits from QueueItem and QueueDisc::Drop only calls methods from the QueueItem base class (no methods specific to QueueDiscItem are called).
Created attachment 2405 [details] Proposed fix v3 Fix a typo spotted by Pasquale
Looks OK to me.
Fixed by changeset 12108:a1ba150121f3