@@ -337,6 +337,9 @@ int switchdev_port_obj_add(struct net_device *dev,
int switchdev_port_obj_del(struct net_device *dev,
const struct switchdev_obj *obj);
+int switchdev_call_replay(struct notifier_block *nb, unsigned long type,
+ struct switchdev_notifier_info *info);
+
int register_switchdev_notifier(struct notifier_block *nb);
int unregister_switchdev_notifier(struct notifier_block *nb);
int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
@@ -306,7 +306,7 @@ br_switchdev_fdb_replay_one(struct net_bridge *br, struct notifier_block *nb,
br_switchdev_fdb_populate(br, &item, fdb, ctx);
- err = nb->notifier_call(nb, action, &item);
+ err = switchdev_call_replay(nb, action, &item.info);
return notifier_to_errno(err);
}
@@ -376,8 +376,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev,
attr.u.vlan_msti.vid = v->vid;
attr.u.vlan_msti.msti = v->msti;
- err = nb->notifier_call(nb, SWITCHDEV_PORT_ATTR_SET,
- &attr_info);
+ err = switchdev_call_replay(nb, SWITCHDEV_PORT_ATTR_SET,
+ &attr_info.info);
err = notifier_to_errno(err);
if (err)
return err;
@@ -404,7 +404,7 @@ br_switchdev_vlan_replay_one(struct notifier_block *nb,
};
int err;
- err = nb->notifier_call(nb, action, &obj_info);
+ err = switchdev_call_replay(nb, action, &obj_info.info);
return notifier_to_errno(err);
}
@@ -590,7 +590,7 @@ br_switchdev_mdb_replay_one(struct notifier_block *nb, struct net_device *dev,
};
int err;
- err = nb->notifier_call(nb, action, &obj_info);
+ err = switchdev_call_replay(nb, action, &obj_info.info);
return notifier_to_errno(err);
}
@@ -307,6 +307,23 @@ int switchdev_port_obj_del(struct net_device *dev,
}
EXPORT_SYMBOL_GPL(switchdev_port_obj_del);
+/**
+ * switchdev_call_replay - Replay switchdev message to driver
+ * @nb: notifier block to send the message to
+ * @type: value passed unmodified to notifier function
+ * @info: notifier information data
+ *
+ * Typically issued by the bridge, as a response to a replay
+ * request initiated by a port that is either attaching to, or
+ * detaching from, that bridge.
+ */
+int switchdev_call_replay(struct notifier_block *nb, unsigned long type,
+ struct switchdev_notifier_info *info)
+{
+ return nb->notifier_call(nb, type, info);
+}
+EXPORT_SYMBOL_GPL(switchdev_call_replay);
+
static ATOMIC_NOTIFIER_HEAD(switchdev_notif_chain);
static BLOCKING_NOTIFIER_HEAD(switchdev_blocking_notif_chain);
This will make it easier to add a tracepoint for all replay messages later on. Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> --- include/net/switchdev.h | 3 +++ net/bridge/br_switchdev.c | 10 +++++----- net/switchdev/switchdev.c | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-)