]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add netem duplication fix from Steve Hemminger.
authorChris Wright <chrisw@osdl.org>
Wed, 8 Jun 2005 22:38:57 +0000 (15:38 -0700)
committerChris Wright <chrisw@osdl.org>
Wed, 8 Jun 2005 22:38:57 +0000 (15:38 -0700)
queue/netem-duplication-fix.patch [new file with mode: 0644]
queue/series

diff --git a/queue/netem-duplication-fix.patch b/queue/netem-duplication-fix.patch
new file mode 100644 (file)
index 0000000..fb9787d
--- /dev/null
@@ -0,0 +1,36 @@
+From shemminger@osdl.org  Wed Jun  8 09:30:09 2005
+Date: Wed, 8 Jun 2005 09:30:09 -0700
+From: Stephen Hemminger <shemminger@osdl.org>
+To: Chris Wright <chrisw@osdl.org>
+Subject: [PATCH] [PKT_SCHED]: netem: duplication fix
+
+Netem duplication can cause infinite loop in qdisc_run
+because the qlen of the parent qdisc is not affected by the duplication.
+
+Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+
+Index: 2.6.11.11-net/net/sched/sch_netem.c
+===================================================================
+--- 2.6.11.11-net.orig/net/sched/sch_netem.c
++++ 2.6.11.11-net/net/sched/sch_netem.c
+@@ -184,10 +184,15 @@ static int netem_enqueue(struct sk_buff 
+       /* Random duplication */
+       if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor)) {
+               struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
+-
+-              pr_debug("netem_enqueue: dup %p\n", skb2);
+-              if (skb2)
+-                      delay_skb(sch, skb2);
++              if (skb2) {
++                      struct Qdisc *rootq = sch->dev->qdisc;
++                      u32 dupsave = q->duplicate; 
++
++                      /* prevent duplicating a dup... */
++                      q->duplicate = 0;
++                      rootq->enqueue(skb2, rootq);
++                      q->duplicate = dupsave;
++              }
+       }
+       /* If doing simple delay then gap == 0 so all packets
index 6707ce90af65c86b7f2f6f7a8d76cbcf07f38210..955fee5af91bc8ca39b601ba3e98b37a3b1438d6 100644 (file)
@@ -6,3 +6,4 @@ x86_64-fix-ptrace-boundary-check.patch
 bttv-vc100.patch
 fix-log_do_checkpoint-assertion-failure.patch
 bridge-fdb-postfilter.patch
+netem-duplication-fix.patch