diff options
author | Petr Machata <petrm@mellanox.com> | 2018-12-06 12:05:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-06 16:26:07 -0500 |
commit | 263726053400b9c6671df8e87d3db9728199da13 (patch) | |
tree | 76b2354dbf9970e551da74ea76d7af760074d50e /net/core/dev.c | |
parent | 6d0403216d030e5623de3911168fceeaac2e14d6 (diff) |
net: core: dev: Add call_netdevice_notifiers_extack()
In order to propagate extack through NETDEV_PRE_UP, add a new function
call_netdevice_notifiers_extack() that primes the extack field of the
notifier info. Convert call_netdevice_notifiers() to a simple wrapper
around the new function that passes NULL for extack.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index b37e320def13..4b033af8e6cd 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -162,6 +162,9 @@ static struct list_head offload_base __read_mostly; | |||
162 | static int netif_rx_internal(struct sk_buff *skb); | 162 | static int netif_rx_internal(struct sk_buff *skb); |
163 | static int call_netdevice_notifiers_info(unsigned long val, | 163 | static int call_netdevice_notifiers_info(unsigned long val, |
164 | struct netdev_notifier_info *info); | 164 | struct netdev_notifier_info *info); |
165 | static int call_netdevice_notifiers_extack(unsigned long val, | ||
166 | struct net_device *dev, | ||
167 | struct netlink_ext_ack *extack); | ||
165 | static struct napi_struct *napi_by_id(unsigned int napi_id); | 168 | static struct napi_struct *napi_by_id(unsigned int napi_id); |
166 | 169 | ||
167 | /* | 170 | /* |
@@ -1734,6 +1737,18 @@ static int call_netdevice_notifiers_info(unsigned long val, | |||
1734 | return raw_notifier_call_chain(&netdev_chain, val, info); | 1737 | return raw_notifier_call_chain(&netdev_chain, val, info); |
1735 | } | 1738 | } |
1736 | 1739 | ||
1740 | static int call_netdevice_notifiers_extack(unsigned long val, | ||
1741 | struct net_device *dev, | ||
1742 | struct netlink_ext_ack *extack) | ||
1743 | { | ||
1744 | struct netdev_notifier_info info = { | ||
1745 | .dev = dev, | ||
1746 | .extack = extack, | ||
1747 | }; | ||
1748 | |||
1749 | return call_netdevice_notifiers_info(val, &info); | ||
1750 | } | ||
1751 | |||
1737 | /** | 1752 | /** |
1738 | * call_netdevice_notifiers - call all network notifier blocks | 1753 | * call_netdevice_notifiers - call all network notifier blocks |
1739 | * @val: value passed unmodified to notifier function | 1754 | * @val: value passed unmodified to notifier function |
@@ -1745,11 +1760,7 @@ static int call_netdevice_notifiers_info(unsigned long val, | |||
1745 | 1760 | ||
1746 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev) | 1761 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev) |
1747 | { | 1762 | { |
1748 | struct netdev_notifier_info info = { | 1763 | return call_netdevice_notifiers_extack(val, dev, NULL); |
1749 | .dev = dev, | ||
1750 | }; | ||
1751 | |||
1752 | return call_netdevice_notifiers_info(val, &info); | ||
1753 | } | 1764 | } |
1754 | EXPORT_SYMBOL(call_netdevice_notifiers); | 1765 | EXPORT_SYMBOL(call_netdevice_notifiers); |
1755 | 1766 | ||