]> git.baikalelectronics.ru Git - kernel.git/commit
netem: refine early skb orphaning
authorEric Dumazet <edumazet@google.com>
Sat, 14 Jul 2012 03:16:27 +0000 (03:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 06:08:33 +0000 (23:08 -0700)
commitaa72aeb8a23e99634dad2f6ab1eea28d7c9a35ea
tree2d2a596e36a3f6c46405c18982d9f4536b24c204
parent38a9336a9940c911d1f2fe7c2e62066c79b64b55
netem: refine early skb orphaning

netem does an early orphaning of skbs. Doing so breaks TCP Small Queue
or any mechanism relying on socket sk_wmem_alloc feedback.

Ideally, we should perform this orphaning after the rate module and
before the delay module, to mimic what happens on a real link :

skb orphaning is indeed normally done at TX completion, before the
transit on the link.

+-------+   +--------+  +---------------+  +-----------------+
+ Qdisc +---> Device +--> TX completion +--> links / hops    +->
+       +   +  xmit  +  + skb orphaning +  + propagation     +
+-------+   +--------+  +---------------+  +-----------------+
      < rate limiting >                  < delay, drops, reorders >

If netem is used without delay feature (drops, reorders, rate
limiting), then we should avoid early skb orphaning, to keep pressure
on sockets as long as packets are still in qdisc queue.

Ideally, netem should be refactored to implement delay module
as the last stage. Current algorithm merges the two phases
(rate limiting + delay) so its not correct.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Mark Gordon <msg@google.com>
Cc: Andreas Terzis <aterzis@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c