]> err.no Git - linux-2.6/blobdiff - net/sched/sch_teql.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[linux-2.6] / net / sched / sch_teql.c
index ade3372221c782a9d8069f95359c87154f2edf00..2c35c678563bec7fafaed3125fe36477b1a7c567 100644 (file)
@@ -83,7 +83,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 
        if (q->q.qlen < dev->tx_queue_len) {
                __skb_queue_tail(&q->q, skb);
-               sch->bstats.bytes += skb->len;
+               sch->bstats.bytes += qdisc_pkt_len(skb);
                sch->bstats.packets++;
                return 0;
        }
@@ -156,12 +156,15 @@ teql_destroy(struct Qdisc* sch)
                                        master->slaves = NEXT_SLAVE(q);
                                        if (q == master->slaves) {
                                                struct netdev_queue *txq;
+                                               spinlock_t *root_lock;
 
                                                txq = netdev_get_tx_queue(master->dev, 0);
                                                master->slaves = NULL;
-                                               spin_lock_bh(&txq->lock);
+
+                                               root_lock = qdisc_root_lock(txq->qdisc);
+                                               spin_lock_bh(root_lock);
                                                qdisc_reset(txq->qdisc);
-                                               spin_unlock_bh(&txq->lock);
+                                               spin_unlock_bh(root_lock);
                                        }
                                }
                                skb_queue_purge(&dat->q);
@@ -275,7 +278,6 @@ static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
        struct Qdisc *start, *q;
        int busy;
        int nores;
-       int len = skb->len;
        int subq = skb_get_queue_mapping(skb);
        struct sk_buff *skb_res = NULL;
 
@@ -303,17 +305,19 @@ restart:
 
                switch (teql_resolve(skb, skb_res, slave)) {
                case 0:
-                       if (netif_tx_trylock(slave)) {
-                               if (!__netif_subqueue_stopped(slave, subq) &&
+                       if (__netif_tx_trylock(slave_txq)) {
+                               if (!netif_tx_queue_stopped(slave_txq) &&
+                                   !netif_tx_queue_frozen(slave_txq) &&
                                    slave->hard_start_xmit(skb, slave) == 0) {
-                                       netif_tx_unlock(slave);
+                                       __netif_tx_unlock(slave_txq);
                                        master->slaves = NEXT_SLAVE(q);
                                        netif_wake_queue(dev);
                                        master->stats.tx_packets++;
-                                       master->stats.tx_bytes += len;
+                                       master->stats.tx_bytes +=
+                                               qdisc_pkt_len(skb);
                                        return 0;
                                }
-                               netif_tx_unlock(slave);
+                               __netif_tx_unlock(slave_txq);
                        }
                        if (netif_queue_stopped(dev))
                                busy = 1;