switchdev: introduce switchdev deferred ops infrastructure

Introduce infrastructure which will be used internally to defer ops.
Note that the deferred ops are queued up and either are processed by
scheduled work or explicitly by user calling deferred_process function.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2015-10-14 19:40:48 +02:00
committed by David S. Miller
parent adc9048c60
commit 793f40147e
2 changed files with 85 additions and 0 deletions

View File

@@ -167,6 +167,7 @@ switchdev_notifier_info_to_dev(const struct switchdev_notifier_info *info)
#ifdef CONFIG_NET_SWITCHDEV
void switchdev_deferred_process(void);
int switchdev_port_attr_get(struct net_device *dev,
struct switchdev_attr *attr);
int switchdev_port_attr_set(struct net_device *dev,
@@ -208,6 +209,10 @@ void switchdev_port_fwd_mark_set(struct net_device *dev,
#else
static inline void switchdev_deferred_process(void)
{
}
static inline int switchdev_port_attr_get(struct net_device *dev,
struct switchdev_attr *attr)
{