]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sched/sch_netem.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[karo-tx-linux.git] / net / sched / sch_netem.c
index c412ad0d0308ed8aedee1c5ce69bce323a32b823..298c0ddfb57e3e5625a69d412c548d198005fd3b 100644 (file)
@@ -380,7 +380,14 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
        }
 
-       skb_orphan(skb);
+       /* If a delay is expected, orphan the skb. (orphaning usually takes
+        * place at TX completion time, so _before_ the link transit delay)
+        * Ideally, this orphaning should be done after the rate limiting
+        * module, because this breaks TCP Small Queue, and other mechanisms
+        * based on socket sk_wmem_alloc.
+        */
+       if (q->latency || q->jitter)
+               skb_orphan(skb);
 
        /*
         * If we need to duplicate packet, then re-insert at top of the