diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2018-01-25 18:26:22 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-29 12:42:15 -0500 |
commit | 6a643ddb5624be7e0694d49f5765a8d41c1ab6d0 (patch) | |
tree | 2daa13ccb3dbe823770ca45732729dfa4a150ef8 /net/core/rtnetlink.c | |
parent | 4cd879515d686849eec5f718aeac62a70b067d82 (diff) | |
download | linux-stable-6a643ddb5624be7e0694d49f5765a8d41c1ab6d0.tar.gz linux-stable-6a643ddb5624be7e0694d49f5765a8d41c1ab6d0.tar.bz2 linux-stable-6a643ddb5624be7e0694d49f5765a8d41c1ab6d0.zip |
net: introduce helper dev_change_tx_queue_len()
This patch promotes the local change_tx_queue_len() to a core
helper function, dev_change_tx_queue_len(), so that rtnetlink
and net-sysfs could share the code. This also prepares for the
following patch.
Note, the -EFAULT in the original code doesn't make sense,
we should propagate the errno from notifiers.
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index e04af7b7f448..061e27cb6c12 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2337,19 +2337,11 @@ static int do_setlink(const struct sk_buff *skb, if (tb[IFLA_TXQLEN]) { unsigned int value = nla_get_u32(tb[IFLA_TXQLEN]); - unsigned int orig_len = dev->tx_queue_len; - - if (dev->tx_queue_len ^ value) { - dev->tx_queue_len = value; - err = call_netdevice_notifiers( - NETDEV_CHANGE_TX_QUEUE_LEN, dev); - err = notifier_to_errno(err); - if (err) { - dev->tx_queue_len = orig_len; - goto errout; - } - status |= DO_SETLINK_MODIFIED; - } + + err = dev_change_tx_queue_len(dev, value); + if (err) + goto errout; + status |= DO_SETLINK_MODIFIED; } if (tb[IFLA_GSO_MAX_SIZE]) { |