Thread (5 messages) flat view 5 messages, 2 authors, 2021-07-29

Re: [PATCH net-next v1 1/2] devlink: Break parameter notification sequence to be before/after unload/load driver

From: Leon Romanovsky <leon@kernel.org>
Date: 2021-07-29 14:39:02
Also in: lkml

On Thu, Jul 29, 2021 at 04:33:58PM +0200, Jiri Pirko wrote:
Thu, Jul 29, 2021 at 03:17:49PM CEST, leon@kernel.org wrote:
quoted
From: Leon Romanovsky <leonro@nvidia.com>
<...>
quoted
+static void devlink_ns_change_notify(struct devlink *devlink,
+				     struct net *dest_net, struct net *curr_net,
+				     enum devlink_command cmd, bool new)
Drop the cmd and determine the DEVLINK_CMD_PARAM_NEW/DEL by "new" arg as
well. I thought I wrote that clearly in my previous review, but
apparently not, sorry about that.


quoted
{
	struct devlink_param_item *param_item;
@@ -3812,17 +3813,17 @@ static void devlink_reload_netns_change(struct devlink *devlink,
	 * 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);
+	if (!dest_net || net_eq(dest_net, curr_net))
+		return;

-	__devlink_net_set(devlink, dest_net);
+	if (new)
+		devlink_notify(devlink, DEVLINK_CMD_NEW);

-	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_param_notify(devlink, 0, param_item, cmd);
Like this:
		devlink_param_notify(devlink, 0, param_item, new ?
				     DEVLINK_CMD_PARAM_NEW ?
				     DEVLINK_CMD_PARAM_DEL);
IMHO it is not nice, but will change.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help