X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=net%2Fcore%2Fdev.c;h=56a6ad8031eb5a24ea6f4a7cf30596ed9bdb4dd6;hp=bb7a0cc037e95647def6b34d52a58038e793d707;hb=3a7b41121346d9d95bee48bf730882c91d1af7bd;hpb=1101a965a700cb8bc180437deb2f078873101930;ds=inline diff --git a/net/core/dev.c b/net/core/dev.c index bb7a0cc037e9..56a6ad8031eb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1750,8 +1750,11 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq) */ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) { + bool disabling; int rc; + disabling = txq < dev->real_num_tx_queues; + if (txq < 1 || txq > dev->num_tx_queues) return -EINVAL; @@ -1767,11 +1770,16 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) if (dev->num_tc) netif_setup_tc(dev, txq); - if (txq < dev->real_num_tx_queues) + dev->real_num_tx_queues = txq; + + if (disabling) { + synchronize_net(); qdisc_reset_all_tx_gt(dev, txq); + } + } else { + dev->real_num_tx_queues = txq; } - dev->real_num_tx_queues = txq; return 0; } EXPORT_SYMBOL(netif_set_real_num_tx_queues);