diff options
author | Petr Machata <petrm@mellanox.com> | 2018-12-12 12:02:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-12 19:34:22 -0500 |
commit | 479c86dc551c9720765ed19433990eae6a1f899f (patch) | |
tree | ecd13ac6dcb54e24d367e781fd5c7bb600804ee7 /include/net/switchdev.h | |
parent | 69b7320e14e6e8c7a77fa5803cecc86434a1162d (diff) |
net: switchdev: Add extack to struct switchdev_notifier_info
In order to pass extack to the drivers that need it, add an extack field
to struct switchdev_notifier_info, and an extack argument to the
function call_switchdev_blocking_notifiers(). Also add a helper function
switchdev_notifier_info_to_extack().
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r-- | include/net/switchdev.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 69016305ad58..4facfa6775e8 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -149,6 +149,7 @@ enum switchdev_notifier_type { | |||
149 | 149 | ||
150 | struct switchdev_notifier_info { | 150 | struct switchdev_notifier_info { |
151 | struct net_device *dev; | 151 | struct net_device *dev; |
152 | struct netlink_ext_ack *extack; | ||
152 | }; | 153 | }; |
153 | 154 | ||
154 | struct switchdev_notifier_fdb_info { | 155 | struct switchdev_notifier_fdb_info { |
@@ -172,6 +173,12 @@ switchdev_notifier_info_to_dev(const struct switchdev_notifier_info *info) | |||
172 | return info->dev; | 173 | return info->dev; |
173 | } | 174 | } |
174 | 175 | ||
176 | static inline struct netlink_ext_ack * | ||
177 | switchdev_notifier_info_to_extack(const struct switchdev_notifier_info *info) | ||
178 | { | ||
179 | return info->extack; | ||
180 | } | ||
181 | |||
175 | #ifdef CONFIG_NET_SWITCHDEV | 182 | #ifdef CONFIG_NET_SWITCHDEV |
176 | 183 | ||
177 | void switchdev_deferred_process(void); | 184 | void switchdev_deferred_process(void); |
@@ -193,7 +200,8 @@ int call_switchdev_notifiers(unsigned long val, struct net_device *dev, | |||
193 | int register_switchdev_blocking_notifier(struct notifier_block *nb); | 200 | int register_switchdev_blocking_notifier(struct notifier_block *nb); |
194 | int unregister_switchdev_blocking_notifier(struct notifier_block *nb); | 201 | int unregister_switchdev_blocking_notifier(struct notifier_block *nb); |
195 | int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev, | 202 | int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev, |
196 | struct switchdev_notifier_info *info); | 203 | struct switchdev_notifier_info *info, |
204 | struct netlink_ext_ack *extack); | ||
197 | 205 | ||
198 | void switchdev_port_fwd_mark_set(struct net_device *dev, | 206 | void switchdev_port_fwd_mark_set(struct net_device *dev, |
199 | struct net_device *group_dev, | 207 | struct net_device *group_dev, |
@@ -278,7 +286,8 @@ unregister_switchdev_blocking_notifier(struct notifier_block *nb) | |||
278 | static inline int | 286 | static inline int |
279 | call_switchdev_blocking_notifiers(unsigned long val, | 287 | call_switchdev_blocking_notifiers(unsigned long val, |
280 | struct net_device *dev, | 288 | struct net_device *dev, |
281 | struct switchdev_notifier_info *info) | 289 | struct switchdev_notifier_info *info, |
290 | struct netlink_ext_ack *extack) | ||
282 | { | 291 | { |
283 | return NOTIFY_DONE; | 292 | return NOTIFY_DONE; |
284 | } | 293 | } |