From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@osdl.org>,
netem@osdl.org, netdev@oss.sgi.com
Subject: Re: [PATCH] netem: restart device after inserting packets
Date: Fri, 10 Dec 2004 04:33:21 +0100 [thread overview]
Message-ID: <41B91901.3070304@trash.net> (raw)
In-Reply-To: <20041208210031.63f0963f.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 712 bytes --]
David S. Miller wrote:
>On Wed, 8 Dec 2004 12:31:03 -0800
>Stephen Hemminger <shemminger@osdl.org> wrote:
>
>
>>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>
>>
>
>Good spotting. Applied, thanks Stephen.
>
The patch is incomplete, netem may dequeue multiple packets from
the delayed queue at once and feed them to the inner queue, but
qdisc_restart will only dequeue one packet from the inner queue.
This patch moves qdisc_run back to include/net/pkt_sched.h and
replaces qdisc_restart by qdisc_run in netem_watchdog.
Regards
Patrick
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2062 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/12/10 04:24:22+01:00 kaber@coreworks.de
# [PKT_SCHED]: Keep netem queue running until inner qdisc is empty
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/sched/sch_netem.c
# 2004/12/10 04:24:13+01:00 kaber@coreworks.de +1 -1
# [PKT_SCHED]: Keep netem queue running until inner qdisc is empty
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/core/dev.c
# 2004/12/10 04:24:13+01:00 kaber@coreworks.de +0 -7
# [PKT_SCHED]: Keep netem queue running until inner qdisc is empty
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# include/net/pkt_sched.h
# 2004/12/10 04:24:13+01:00 kaber@coreworks.de +6 -0
# [PKT_SCHED]: Keep netem queue running until inner qdisc is empty
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h
--- a/include/net/pkt_sched.h 2004-12-10 04:24:54 +01:00
+++ b/include/net/pkt_sched.h 2004-12-10 04:24:54 +01:00
@@ -228,6 +228,12 @@
extern int qdisc_restart(struct net_device *dev);
+static inline void qdisc_run(struct net_device *dev)
+{
+ while (!netif_queue_stopped(dev) && qdisc_restart(dev) < 0)
+ /* NOTHING */;
+}
+
extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
struct tcf_result *res);
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c 2004-12-10 04:24:54 +01:00
+++ b/net/core/dev.c 2004-12-10 04:24:54 +01:00
@@ -1202,13 +1202,6 @@
} \
}
-static inline void qdisc_run(struct net_device *dev)
-{
- while (!netif_queue_stopped(dev) &&
- qdisc_restart(dev)<0)
- /* NOTHING */;
-}
-
/**
* dev_queue_xmit - transmit a buffer
* @skb: buffer to transmit
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c 2004-12-10 04:24:54 +01:00
+++ b/net/sched/sch_netem.c 2004-12-10 04:24:54 +01:00
@@ -287,7 +287,7 @@
else
sch->q.qlen++;
}
- qdisc_restart(dev);
+ qdisc_run(dev);
spin_unlock_bh(&dev->queue_lock);
}
next prev parent reply other threads:[~2004-12-10 3:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-08 20:31 [PATCH] netem: restart device after inserting packets Stephen Hemminger
2004-12-09 5:00 ` David S. Miller
2004-12-10 3:33 ` Patrick McHardy [this message]
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=41B91901.3070304@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
--cc=netem@osdl.org \
--cc=shemminger@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).