summaryrefslogtreecommitdiff
path: root/net/devlink
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-01-27 16:50:41 +0100
committerDavid S. Miller <davem@davemloft.net>2023-01-30 08:37:46 +0000
commita131315a47bbb5e89a3330cac69fe6ab4836f762 (patch)
treefc074fcca424b129eb58fc90a83cd0e37bbfc4bd /net/devlink
parent7d7e9169a3ecdc14a4921b2130066ce26952c9e1 (diff)
downloadlwn-a131315a47bbb5e89a3330cac69fe6ab4836f762.tar.gz
lwn-a131315a47bbb5e89a3330cac69fe6ab4836f762.zip
devlink: send objects notifications during devlink reload
Currently, the notifications are only sent for params. People who introduced other objects forgot to add the reload notifications here. To make sure all notifications happen according to existing comment, benefit from existence of devlink_notify_register/unregister() helpers and use them in reload code. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/devlink')
-rw-r--r--net/devlink/leftover.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 24e20861a28b..4f78ef5a46af 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -4230,36 +4230,20 @@ static struct net *devlink_netns_get(struct sk_buff *skb,
return net;
}
-static void devlink_param_notify(struct devlink *devlink,
- unsigned int port_index,
- struct devlink_param_item *param_item,
- enum devlink_command cmd);
-
static void devlink_reload_netns_change(struct devlink *devlink,
struct net *curr_net,
struct net *dest_net)
{
- struct devlink_param_item *param_item;
-
/* Userspace needs to be notified about devlink objects
* removed from original and entering new network namespace.
* The rest of the devlink objects are re-created during
* reload process so the notifications are generated separatelly.
*/
-
- list_for_each_entry(param_item, &devlink->param_list, list)
- devlink_param_notify(devlink, 0, param_item,
- DEVLINK_CMD_PARAM_DEL);
- devlink_notify(devlink, DEVLINK_CMD_DEL);
-
+ devlink_notify_unregister(devlink);
move_netdevice_notifier_net(curr_net, dest_net,
&devlink->netdevice_nb);
write_pnet(&devlink->_net, dest_net);
-
- devlink_notify(devlink, DEVLINK_CMD_NEW);
- list_for_each_entry(param_item, &devlink->param_list, list)
- devlink_param_notify(devlink, 0, param_item,
- DEVLINK_CMD_PARAM_NEW);
+ devlink_notify_register(devlink);
}
static void devlink_reload_failed_set(struct devlink *devlink,