Messages in this thread | | | Date | Thu, 29 Jul 2021 17:38:55 +0300 | From | Leon Romanovsky <> | Subject | Re: [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
| |