diff options
| author | David S. Miller <davem@davemloft.net> | 2018-10-13 07:38:46 +0300 | 
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-10-13 07:38:46 +0300 | 
| commit | d864991b220b7c62e81d21209e1fd978fd67352c (patch) | |
| tree | b570a1ad6fc1b959c5bcda6ceca0b321319c01e0 /net/core/dev.c | |
| parent | a688c53a0277d8ea21d86a5c56884892e3442c5e (diff) | |
| parent | bab5c80b211035739997ebd361a679fa85b39465 (diff) | |
| download | linux-d864991b220b7c62e81d21209e1fd978fd67352c.tar.xz | |
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)  }  EXPORT_SYMBOL(call_netdevice_notifiers); +/** + *	call_netdevice_notifiers_mtu - call all network notifier blocks + *	@val: value passed unmodified to notifier function + *	@dev: net_device pointer passed unmodified to notifier function + *	@arg: additional u32 argument passed to the notifier function + * + *	Call all network notifier blocks.  Parameters and return value + *	are as for raw_notifier_call_chain(). + */ +static int call_netdevice_notifiers_mtu(unsigned long val, +					struct net_device *dev, u32 arg) +{ +	struct netdev_notifier_info_ext info = { +		.info.dev = dev, +		.ext.mtu = arg, +	}; + +	BUILD_BUG_ON(offsetof(struct netdev_notifier_info_ext, info) != 0); + +	return call_netdevice_notifiers_info(val, &info.info); +} +  #ifdef CONFIG_NET_INGRESS  static DEFINE_STATIC_KEY_FALSE(ingress_needed_key); @@ -7575,14 +7597,16 @@ int dev_set_mtu_ext(struct net_device *dev, int new_mtu,  	err = __dev_set_mtu(dev, new_mtu);  	if (!err) { -		err = call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); +		err = call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev, +						   orig_mtu);  		err = notifier_to_errno(err);  		if (err) {  			/* setting mtu back and notifying everyone again,  			 * so that they have a chance to revert changes.  			 */  			__dev_set_mtu(dev, orig_mtu); -			call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); +			call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev, +						     new_mtu);  		}  	}  	return err;  | 
