From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>
Subject: [NET_SCHED 11/11]: qdisc: avoid dequeue while throttled
Date: Fri, 23 Mar 2007 14:35:53 +0100 (MET) [thread overview]
Message-ID: <20070323133528.10264.68156.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070323133513.10264.16515.sendpatchset@localhost.localdomain>
[NET_SCHED]: qdisc: avoid dequeue while throttled
Avoid dequeueing while the device is throttled.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 69f6039ded0bdaf93e3fc954140caae1e7fc9927
tree 9894ce3afc9f7e5cadb26269827ba4d4bca393fc
parent e2459acd7dee06fb4d5e980f26c23d31db0e5de1
author Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 10:31:32 +0100
committer Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 10:31:32 +0100
net/sched/sch_generic.c | 4 ++++
net/sched/sch_netem.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 52eb343..39c5312 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -93,6 +93,10 @@ static inline int qdisc_restart(struct net_device *dev)
struct Qdisc *q = dev->qdisc;
struct sk_buff *skb;
+ smp_rmb();
+ if (q->flags & TCQ_F_THROTTLED)
+ return q->q.qlen;
+
/* Dequeue packet */
if (((skb = dev->gso_skb)) || ((skb = q->dequeue(q)))) {
unsigned nolock = (dev->features & NETIF_F_LLTX);
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 5d9d8bc..4c7a8d8 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -273,10 +273,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
struct netem_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
- smp_mb();
- if (sch->flags & TCQ_F_THROTTLED)
- return NULL;
-
skb = q->qdisc->dequeue(q->qdisc);
if (skb) {
const struct netem_skb_cb *cb
next prev parent reply other threads:[~2007-03-23 13:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 13:35 [NET_SCHED 00/11]: pkt_sched.h cleanup + misc changes Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 01/11]: sch_netem: fix off-by-one in send time comparison Patrick McHardy
2007-03-23 16:34 ` Stephen Hemminger
2007-03-23 13:35 ` [NET_SCHED 02/11]: kill PSCHED_AUDIT_TDIFF Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 03/11]: kill PSCHED_TADD/PSCHED_TADD2 Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 04/11]: kill PSCHED_TLESS Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 05/11]: kill PSCHED_SET_PASTPERFECT/PSCHED_IS_PASTPERFECT Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 06/11]: kill PSCHED_TDIFF Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 07/11]: turn PSCHED_TDIFF_SAFE into inline function Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 08/11]: turn PSCHED_GET_TIME " Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 09/11]: Unline tcf_destroy Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 10/11]: qdisc: remove unnecessary memory barriers Patrick McHardy
2007-03-23 13:35 ` Patrick McHardy [this message]
2007-03-23 14:39 ` [NET_SCHED 11/11]: qdisc: avoid dequeue while throttled Patrick McHardy
2007-03-23 14:57 ` Patrick McHardy
2007-03-23 18:26 ` David Miller
2007-03-23 18:30 ` [NET_SCHED 00/11]: pkt_sched.h cleanup + misc changes David 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=20070323133528.10264.68156.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).