From: Stephen Hemminger <shemminger@linux-foundation.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [RFC] qdisc_run de inline.
Date: Wed, 30 May 2007 09:23:24 -0700 [thread overview]
Message-ID: <20070530092324.2f0fa703@freepuppy> (raw)
It isn't worth inlining qdisc_run, into two parts. The code is
cleaner (and smaller) to just have it as one routine.
--- a/include/net/pkt_sched.h 2007-05-02 12:26:34.000000000 -0700
+++ b/include/net/pkt_sched.h 2007-05-30 09:12:22.000000000 -0700
@@ -80,14 +80,7 @@ extern struct qdisc_rate_table *qdisc_ge
struct rtattr *tab);
extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
-extern void __qdisc_run(struct net_device *dev);
-
-static inline void qdisc_run(struct net_device *dev)
-{
- if (!netif_queue_stopped(dev) &&
- !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state))
- __qdisc_run(dev);
-}
+extern void qdisc_run(struct net_device *dev);
extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
struct tcf_result *res);
--- a/net/sched/sch_generic.c 2007-05-29 08:14:38.000000000 -0700
+++ b/net/sched/sch_generic.c 2007-05-30 09:14:08.000000000 -0700
@@ -177,14 +177,16 @@ out:
return q->q.qlen;
}
-void __qdisc_run(struct net_device *dev)
+void qdisc_run(struct net_device *dev)
{
- do {
- if (!qdisc_restart(dev))
- break;
- } while (!netif_queue_stopped(dev));
+ if (!test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state)) {
+ while (!netif_queue_stopped(dev)) {
+ if (!qdisc_restart(dev))
+ break;
+ }
- clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state);
+ clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state);
+ }
}
static void dev_watchdog(unsigned long arg)
next reply other threads:[~2007-05-30 16:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-30 16:23 Stephen Hemminger [this message]
2007-05-31 8:29 ` [RFC] qdisc_run de inline 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=20070530092324.2f0fa703@freepuppy \
--to=shemminger@linux-foundation.org \
--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