Skip to contentSkip to conversation

qdisc_run de inline.

RFC In review Stephen Hemminger 2 participants 2 messages May 30, 2007 – May 31, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 qdisc_run de inline.

It isn't worth inlining qdisc_run, into two parts. The code is cleaner (and smaller) to just have it as one routine.

include/net/pkt_sched.h +1 -8
@@ -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);
net/sched/sch_generic.c +8 -6
@@ -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)
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Wed, 30 May 2007 09:23:24 -0700

Quoted 2 lines

It isn't worth inlining qdisc_run, into two parts. The code is cleaner (and smaller) to just have it as one routine.

This looks fine to me, I'll queue it up for 2.6.23 once I cut the net-2.6.23 tree.

Thanks.