aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-09 02:11:25 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-09 02:11:25 -0400
commit86d804e10a37cd86f16bf72386c37e843a98a74b (patch)
tree04483a937f11c752aea998298a27fc79e6851b2d /net
parent970565bbad0c7b98db0d14131a69e5a0f4445d49 (diff)
netdev: Make netif_schedule() routines work with netdev_queue objects.
Only plain netif_schedule() remains taking a net_device, mostly as a compatability item while we transition the rest of these interfaces. Everything else calls netif_schedule_queue() or __netif_schedule(), both of which take a netdev_queue pointer. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c9
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/sched/sch_api.c4
-rw-r--r--net/sched/sch_cbq.c2
-rw-r--r--net/sched/sch_generic.c10
5 files changed, 15 insertions, 14 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d6b8d3c3e6ec..0dc888ad4217 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1320,12 +1320,13 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
1320} 1320}
1321 1321
1322 1322
1323void __netif_schedule(struct net_device *dev) 1323void __netif_schedule(struct netdev_queue *txq)
1324{ 1324{
1325 struct net_device *dev = txq->dev;
1326
1325 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { 1327 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
1326 struct netdev_queue *txq = &dev->tx_queue;
1327 unsigned long flags;
1328 struct softnet_data *sd; 1328 struct softnet_data *sd;
1329 unsigned long flags;
1329 1330
1330 local_irq_save(flags); 1331 local_irq_save(flags);
1331 sd = &__get_cpu_var(softnet_data); 1332 sd = &__get_cpu_var(softnet_data);
@@ -1932,7 +1933,7 @@ static void net_tx_action(struct softirq_action *h)
1932 qdisc_run(dev); 1933 qdisc_run(dev);
1933 spin_unlock(&txq->lock); 1934 spin_unlock(&txq->lock);
1934 } else { 1935 } else {
1935 netif_schedule(dev); 1936 netif_schedule_queue(txq);
1936 } 1937 }
1937 } 1938 }
1938 } 1939 }
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 2968baa66b91..1c4d3ba6b878 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -885,10 +885,10 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
885 spin_unlock_bh(&txq->lock); 885 spin_unlock_bh(&txq->lock);
886 886
887 /* we just requeued the all the frames that were in the removed 887 /* we just requeued the all the frames that were in the removed
888 * queue, and since we might miss a softirq we do netif_schedule. 888 * queue, and since we might miss a softirq we do netif_schedule_queue.
889 * ieee80211_wake_queue is not used here as this queue is not 889 * ieee80211_wake_queue is not used here as this queue is not
890 * necessarily stopped */ 890 * necessarily stopped */
891 netif_schedule(local->mdev); 891 netif_schedule_queue(txq);
892 spin_lock_bh(&sta->lock); 892 spin_lock_bh(&sta->lock);
893 *state = HT_AGG_STATE_IDLE; 893 *state = HT_AGG_STATE_IDLE;
894 sta->ampdu_mlme.addba_req_num[tid] = 0; 894 sta->ampdu_mlme.addba_req_num[tid] = 0;
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index e73bd68aa7ae..95873f8dd37c 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -282,11 +282,11 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
282{ 282{
283 struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog, 283 struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog,
284 timer); 284 timer);
285 struct net_device *dev = qdisc_dev(wd->qdisc); 285 struct netdev_queue *txq = wd->qdisc->dev_queue;
286 286
287 wd->qdisc->flags &= ~TCQ_F_THROTTLED; 287 wd->qdisc->flags &= ~TCQ_F_THROTTLED;
288 smp_wmb(); 288 smp_wmb();
289 netif_schedule(dev); 289 netif_schedule_queue(txq);
290 290
291 return HRTIMER_NORESTART; 291 return HRTIMER_NORESTART;
292} 292}
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 99ce3da2b0a4..4efc836cbf38 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -650,7 +650,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
650 } 650 }
651 651
652 sch->flags &= ~TCQ_F_THROTTLED; 652 sch->flags &= ~TCQ_F_THROTTLED;
653 netif_schedule(qdisc_dev(sch)); 653 netif_schedule_queue(sch->dev_queue);
654 return HRTIMER_NORESTART; 654 return HRTIMER_NORESTART;
655} 655}
656 656
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 8247a406a401..407dfdb142a4 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -62,7 +62,7 @@ static inline int qdisc_qlen(struct Qdisc *q)
62 return q->q.qlen; 62 return q->q.qlen;
63} 63}
64 64
65static inline int dev_requeue_skb(struct sk_buff *skb, struct net_device *dev, 65static inline int dev_requeue_skb(struct sk_buff *skb,
66 struct netdev_queue *dev_queue, 66 struct netdev_queue *dev_queue,
67 struct Qdisc *q) 67 struct Qdisc *q)
68{ 68{
@@ -71,7 +71,7 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct net_device *dev,
71 else 71 else
72 q->ops->requeue(skb, q); 72 q->ops->requeue(skb, q);
73 73
74 netif_schedule(dev); 74 netif_schedule_queue(dev_queue);
75 return 0; 75 return 0;
76} 76}
77 77
@@ -114,7 +114,7 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
114 * some time. 114 * some time.
115 */ 115 */
116 __get_cpu_var(netdev_rx_stat).cpu_collision++; 116 __get_cpu_var(netdev_rx_stat).cpu_collision++;
117 ret = dev_requeue_skb(skb, dev, dev_queue, q); 117 ret = dev_requeue_skb(skb, dev_queue, q);
118 } 118 }
119 119
120 return ret; 120 return ret;
@@ -179,7 +179,7 @@ static inline int qdisc_restart(struct net_device *dev)
179 printk(KERN_WARNING "BUG %s code %d qlen %d\n", 179 printk(KERN_WARNING "BUG %s code %d qlen %d\n",
180 dev->name, ret, q->q.qlen); 180 dev->name, ret, q->q.qlen);
181 181
182 ret = dev_requeue_skb(skb, dev, txq, q); 182 ret = dev_requeue_skb(skb, txq, q);
183 break; 183 break;
184 } 184 }
185 185
@@ -200,7 +200,7 @@ void __qdisc_run(struct net_device *dev)
200 * 2. we've been doing it for too long. 200 * 2. we've been doing it for too long.
201 */ 201 */
202 if (need_resched() || jiffies != start_time) { 202 if (need_resched() || jiffies != start_time) {
203 netif_schedule(dev); 203 netif_schedule_queue(&dev->tx_queue);
204 break; 204 break;
205 } 205 }
206 } 206 }