diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
commit | d864991b220b7c62e81d21209e1fd978fd67352c (patch) | |
tree | b570a1ad6fc1b959c5bcda6ceca0b321319c01e0 /net/core/dev.c | |
parent | a688c53a0277d8ea21d86a5c56884892e3442c5e (diff) | |
parent | bab5c80b211035739997ebd361a679fa85b39465 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 0b2d777e5b9e..a4d39b87b4e5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1752,6 +1752,28 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev) | |||
1752 | } | 1752 | } |
1753 | EXPORT_SYMBOL(call_netdevice_notifiers); | 1753 | EXPORT_SYMBOL(call_netdevice_notifiers); |
1754 | 1754 | ||
1755 | /** | ||
1756 | * call_netdevice_notifiers_mtu - call all network notifier blocks | ||
1757 | * @val: value passed unmodified to notifier function | ||
1758 | * @dev: net_device pointer passed unmodified to notifier function | ||
1759 | * @arg: additional u32 argument passed to the notifier function | ||
1760 | * | ||
1761 | * Call all network notifier blocks. Parameters and return value | ||
1762 | * are as for raw_notifier_call_chain(). | ||
1763 | */ | ||
1764 | static int call_netdevice_notifiers_mtu(unsigned long val, | ||
1765 | struct net_device *dev, u32 arg) | ||
1766 | { | ||
1767 | struct netdev_notifier_info_ext info = { | ||
1768 | .info.dev = dev, | ||
1769 | .ext.mtu = arg, | ||
1770 | }; | ||
1771 | |||
1772 | BUILD_BUG_ON(offsetof(struct netdev_notifier_info_ext, info) != 0); | ||
1773 | |||
1774 | return call_netdevice_notifiers_info(val, &info.info); | ||
1775 | } | ||
1776 | |||
1755 | #ifdef CONFIG_NET_INGRESS | 1777 | #ifdef CONFIG_NET_INGRESS |
1756 | static DEFINE_STATIC_KEY_FALSE(ingress_needed_key); | 1778 | static DEFINE_STATIC_KEY_FALSE(ingress_needed_key); |
1757 | 1779 | ||
@@ -7575,14 +7597,16 @@ int dev_set_mtu_ext(struct net_device *dev, int new_mtu, | |||
7575 | err = __dev_set_mtu(dev, new_mtu); | 7597 | err = __dev_set_mtu(dev, new_mtu); |
7576 | 7598 | ||
7577 | if (!err) { | 7599 | if (!err) { |
7578 | err = call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); | 7600 | err = call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev, |
7601 | orig_mtu); | ||
7579 | err = notifier_to_errno(err); | 7602 | err = notifier_to_errno(err); |
7580 | if (err) { | 7603 | if (err) { |
7581 | /* setting mtu back and notifying everyone again, | 7604 | /* setting mtu back and notifying everyone again, |
7582 | * so that they have a chance to revert changes. | 7605 | * so that they have a chance to revert changes. |
7583 | */ | 7606 | */ |
7584 | __dev_set_mtu(dev, orig_mtu); | 7607 | __dev_set_mtu(dev, orig_mtu); |
7585 | call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); | 7608 | call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev, |
7609 | new_mtu); | ||
7586 | } | 7610 | } |
7587 | } | 7611 | } |
7588 | return err; | 7612 | return err; |