diff options
Diffstat (limited to 'net/core/dev_ioctl.c')
| -rw-r--r-- | net/core/dev_ioctl.c | 14 | 
1 files changed, 13 insertions, 1 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 709a4e6fb447..7e690d0ccd05 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #include <linux/kmod.h>  #include <linux/netdevice.h>  #include <linux/etherdevice.h> @@ -303,7 +304,18 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)  	case SIOCSIFTXQLEN:  		if (ifr->ifr_qlen < 0)  			return -EINVAL; -		dev->tx_queue_len = ifr->ifr_qlen; +		if (dev->tx_queue_len ^ ifr->ifr_qlen) { +			unsigned int orig_len = dev->tx_queue_len; + +			dev->tx_queue_len = ifr->ifr_qlen; +			err = call_netdevice_notifiers( +					NETDEV_CHANGE_TX_QUEUE_LEN, dev); +			err = notifier_to_errno(err); +			if (err) { +				dev->tx_queue_len = orig_len; +				return err; +			} +		}  		return 0;  	case SIOCSIFNAME:  |