net: sch_generic: react upon IFF_NO_QUEUE flag
authorPhil Sutter <phil@nwl.cc>
Thu, 13 Aug 2015 17:01:07 +0000 (19:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Aug 2015 18:50:18 +0000 (11:50 -0700)
Handle IFF_NO_QUEUE as alternative to tx_queue_len being zero.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c

index 6efca30894aad4294824d2ba64f732239a921517..942fea8405a476a3f4e23db9a826b8b5fe5f4ecd 100644 (file)
@@ -735,7 +735,7 @@ static void attach_one_default_qdisc(struct net_device *dev,
 {
        struct Qdisc *qdisc = &noqueue_qdisc;
 
-       if (dev->tx_queue_len) {
+       if (dev->tx_queue_len && !(dev->priv_flags & IFF_NO_QUEUE)) {
                qdisc = qdisc_create_dflt(dev_queue,
                                          default_qdisc_ops, TC_H_ROOT);
                if (!qdisc) {
@@ -755,7 +755,9 @@ static void attach_default_qdiscs(struct net_device *dev)
 
        txq = netdev_get_tx_queue(dev, 0);
 
-       if (!netif_is_multiqueue(dev) || dev->tx_queue_len == 0) {
+       if (!netif_is_multiqueue(dev) ||
+           dev->tx_queue_len == 0 ||
+           dev->priv_flags & IFF_NO_QUEUE) {
                netdev_for_each_tx_queue(dev, attach_one_default_qdisc, NULL);
                dev->qdisc = txq->qdisc_sleeping;
                atomic_inc(&dev->qdisc->refcnt);