Skip to content

Commit

Permalink
dev_ioctl: add missing NETDEV_CHANGE_TX_QUEUE_LEN event notification
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lxin authored and davem330 committed Oct 16, 2017
1 parent c019b51 commit 823038c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion net/core/dev_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 823038c

Please sign in to comment.