All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@nvidia.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Parav Pandit <parav@nvidia.com>
Subject: Re: [PATCH net-next v1 1/2] devlink: Break parameter notification sequence to be before/after unload/load driver
Date: Thu, 29 Jul 2021 17:38:55 +0300	[thread overview]
Message-ID: <YQK9fxkb0FIYkzbx@unreal> (raw)
In-Reply-To: <YQK8VkXweZmWTggC@nanopsycho>

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

  reply	other threads:[~2021-07-29 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 13:17 [PATCH net-next v1 0/2] Clean devlink net namespace operations Leon Romanovsky
2021-07-29 13:17 ` [PATCH net-next v1 1/2] devlink: Break parameter notification sequence to be before/after unload/load driver Leon Romanovsky
2021-07-29 14:33   ` Jiri Pirko
2021-07-29 14:38     ` Leon Romanovsky [this message]
2021-07-29 13:17 ` [PATCH net-next v1 2/2] devlink: Allocate devlink directly in requested net namespace Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YQK9fxkb0FIYkzbx@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.