summary refs log tree commit diff
path: root/net/core/dev_ioctl.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-10-16 19:43:15 +0800
committerDavid S. Miller <davem@davemloft.net>2017-10-16 21:23:10 +0100
commit823038ca030e9f8283518b1e6a5a6879edcbe057 (patch)
tree0ea32fc3e9ca2f86980d357a14d87478c10bbf18 /net/core/dev_ioctl.c
parentc019b5166e11faaf9ed3b64316ed338eaa19de60 (diff)
downloadlinux-823038ca030e9f8283518b1e6a5a6879edcbe057.tar.gz
dev_ioctl: add missing NETDEV_CHANGE_TX_QUEUE_LEN event notification
When changing dev tx_queue_len via netlink or net-sysfs,
a NETDEV_CHANGE_TX_QUEUE_LEN event notification will be
called.

But dev_ioctl missed this event notification, which could
cause no userspace notification would be sent.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev_ioctl.c')
-rw-r--r--net/core/dev_ioctl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 709a4e6fb447..f9c7a88cd981 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -303,7 +303,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: