lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v1 1/2] devlink: Break parameter notification sequence to be before/after unload/load driver
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:
> >From: Leon Romanovsky <leonro@nvidia.com>

<...>

> >+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.
>
>
>
> > {
> > 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

\
 
 \ /
  Last update: 2021-07-29 16:39    [W:0.046 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site