Subject: Re: qdisc_enqueue, NET_XMIT_SUCCESS and kfree_skb

From: Patrick McHardy <[email-masked]>
Date: Tue, 19 Aug 2008 15:08:57 +0200

Herbert Xu wrote:
> David Miller <[email-masked]> wrote:
>> In fact, as I look at how TBF and NETEM want to use ->requeue() they
>> could just the same implement it using my suggested alternative for
>> ->requeue() which is just an SKB list ala gso_list hung off of the
>> qdisc.
> 
> For TBF at least its requeue is actually a bit more sophisticated.
> For example, if you hang a prio qdisc off a TBF, then when the
> packet is requeued into the prio, the next time TBF dequeues it,
> it may get a different packet (of a higher priority).
> 
> If you stick it to a list without requeueing, then packets of a
> higher priority won't be able to jump the queue anymore.
> 
> It might be possible to rewrite TBF to not use requeueing, after
> all HTB does it all without requeueing.  However as it stands,
> TBF does need it.
> 
> I haven't followed this thread closely so what is the main problem
> with requeueing (apart from being abused by things like LLTX drivers
> and/or NETEM, nothing other than qdiscs like TBF should use it)?
> 
> Another possibility would to replace requeue by a peek+force_dequeue
> interface, where you can peek at the next packet, and you could then
> dequeue that particular packet if you're satisfied.

That would be fine for TBF since it only needs to check whether
the current packet exceeds the limit and reschedule otherwise.
HFSC OTOH really needs to know the length of the next packet for
calculating the deadline.