diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-02-26 08:39:26 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-02-26 08:41:15 +0100 |
| commit | 3f7df3efeb415610d27aecc282ff96d4a22f0168 (patch) | |
| tree | 0f66382746a1311043a25320243ff5f4b10c282e /net/core/dev.c | |
| parent | x86/mm: Optimize boot-time paging mode switching cost (diff) | |
| parent | Linux 4.16-rc3 (diff) | |
| download | linux-3f7df3efeb415610d27aecc282ff96d4a22f0168.tar.gz linux-3f7df3efeb415610d27aecc282ff96d4a22f0168.zip | |
Merge tag 'v4.16-rc3' into x86/mm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index dda9d7b9a840..d4362befe7e2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2382,8 +2382,11 @@ EXPORT_SYMBOL(netdev_set_num_tc); */ 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; @@ -2399,15 +2402,19 @@ 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); #ifdef CONFIG_XPS netif_reset_xps_queues_gt(dev, txq); #endif } + } else { + dev->real_num_tx_queues = txq; } - dev->real_num_tx_queues = txq; return 0; } EXPORT_SYMBOL(netif_set_real_num_tx_queues); |
