netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: netem@osdl.org, netdev@oss.sgi.com
Subject: [PATCH] netem: restart device after inserting packets
Date: Wed, 8 Dec 2004 12:31:03 -0800	[thread overview]
Message-ID: <20041208123103.4cc6b005@dxpl.pdx.osdl.net> (raw)

The version of netem in 2.6.10 moves packets from the delayed queue
to the qdisc in a timer interrupt. But it forgot to force the device to
pick them up.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c	2004-12-08 12:29:12 -08:00
+++ b/net/sched/sch_netem.c	2004-12-08 12:29:12 -08:00
@@ -258,12 +258,13 @@
 {
 	struct Qdisc *sch = (struct Qdisc *)arg;
 	struct netem_sched_data *q = qdisc_priv(sch);
+	struct net_device *dev = sch->dev;
 	struct sk_buff *skb;
 	psched_time_t now;
 
 	pr_debug("netem_watchdog: fired @%lu\n", jiffies);
 
-	spin_lock_bh(&sch->dev->queue_lock);
+	spin_lock_bh(&dev->queue_lock);
 	PSCHED_GET_TIME(now);
 
 	while ((skb = skb_peek(&q->delayed)) != NULL) {
@@ -286,7 +287,8 @@
 		else
 			sch->q.qlen++;
 	}
-	spin_unlock_bh(&sch->dev->queue_lock);
+	qdisc_restart(dev);
+	spin_unlock_bh(&dev->queue_lock);
 }
 
 static void netem_reset(struct Qdisc *sch)

             reply	other threads:[~2004-12-08 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-08 20:31 Stephen Hemminger [this message]
2004-12-09  5:00 ` [PATCH] netem: restart device after inserting packets David S. Miller
2004-12-10  3:33   ` Patrick McHardy
2004-12-13 19:08     ` Stephen Hemminger
2004-12-14 19:32     ` David S. Miller
2004-12-14 21:11       ` Stephen Hemminger
2004-12-20 23:43         ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041208123103.4cc6b005@dxpl.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=netem@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).