David S. Miller wrote: > On Wed, 04 May 2005 01:48:02 +0200 > Patrick McHardy wrote: > > >>That's what I already suggested, it should be pretty simple to do >>so. I'll send a patch once your tree appears on kernel.org. This one should work. It keeps a pointer to the parent qdisc in struct Qdisc and adjusts q.qlen of all parent qdiscs in netem. The __parent pointer also used by CBQ is renamed to parentq and is used for this. To avoid confusion, the parent classid is also renamed to parentcl. It should work with all currently included classful qdiscs except HFSC. Statistics are not correctly updated (and can't be without support from the qdisc since classes are internal to it), we need to keep this in mind in case a qdisc like RED which uses qstats.backlog for calculations is converted to a classful one. Fixing HFSC is very low priority, it could only use netem in work-conserving mode anyway. My favourite solution would be to avoid this hack and let tc actions handle duplication, as Jamal suggested. My previous point against this of not necessarily having an identical classification result for the duplicated packet as the original one is actually a plus since it provides more flexibility. Steven, what do you think about it? Signed-off-by: Patrick McHardy