summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-02-19 18:46:11 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-19 18:46:11 -0500
commitf5c0c6f4299f870f074235fbf552ecf957fc249c (patch)
tree6b46b9c0b271185b6f98fab350c3891042e729b1 /net/core
parent26736a08ee0fb89a4f09bfb2c9f0805028ff63aa (diff)
parent79c0ef3e85c015b0921a8fd5dd539d1480e9cd6c (diff)
downloadlinux-f5c0c6f4299f870f074235fbf552ecf957fc249c.tar.bz2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 4bd4ad7ffda4..5bdcc5a161fe 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);