• H
    [NET]: Prevent multiple qdisc runs · 48d83325
    Herbert Xu 提交于
    Having two or more qdisc_run's contend against each other is bad because
    it can induce packet reordering if the packets have to be requeued.  It
    appears that this is an unintended consequence of relinquinshing the queue
    lock while transmitting.  That in turn is needed for devices that spend a
    lot of time in their transmit routine.
    
    There are no advantages to be had as devices with queues are inherently
    single-threaded (the loopback device is not but then it doesn't have a
    queue).
    
    Even if you were to add a queue to a parallel virtual device (e.g., bolt
    a tbf filter in front of an ipip tunnel device), you would still want to
    process the queue in sequence to ensure that the packets are ordered
    correctly.
    
    The solution here is to steal a bit from net_device to prevent this.
    
    BTW, as qdisc_restart is no longer used by anyone as a module inside the
    kernel (IIRC it used to with netif_wake_queue), I have not exported the
    new __qdisc_run function.
    Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    48d83325
sch_generic.c 15.0 KB