Skip to content

Commit

Permalink
tuntap: restore default qdisc
Browse files Browse the repository at this point in the history
After commit f84bb1e ("net: fix IFF_NO_QUEUE for drivers using
alloc_netdev"), default qdisc was changed to noqueue because
tuntap does not set tx_queue_len during .setup(). This patch restores
default qdisc by setting tx_queue_len in tun_setup().

Fixes: f84bb1e ("net: fix IFF_NO_QUEUE for drivers using alloc_netdev")
Cc: Phil Sutter <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Acked-by: Phil Sutter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jasowang authored and davem330 committed Apr 8, 2016
1 parent 94a57f1 commit 016adb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,6 @@ static void tun_net_init(struct net_device *dev)
/* Zero header length */
dev->type = ARPHRD_NONE;
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */
break;

case IFF_TAP:
Expand All @@ -1027,7 +1026,6 @@ static void tun_net_init(struct net_device *dev)

eth_hw_addr_random(dev);

dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */
break;
}
}
Expand Down Expand Up @@ -1481,6 +1479,8 @@ static void tun_setup(struct net_device *dev)

dev->ethtool_ops = &tun_ethtool_ops;
dev->destructor = tun_free_netdev;
/* We prefer our own queue length */
dev->tx_queue_len = TUN_READQ_SIZE;
}

/* Trivial set of netlink ops to allow deleting tun or tap
Expand Down

0 comments on commit 016adb7

Please sign in to comment.