lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc1ccc5c-a8fd-35f6-7a11-59603f2db7d5@intel.com>
Date:   Fri, 27 Jan 2023 16:08:34 -0800
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Jiri Pirko <jiri@...nulli.us>, <netdev@...r.kernel.org>
CC:     <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
        <edumazet@...gle.com>, <michael.chan@...adcom.com>,
        <yisen.zhuang@...wei.com>, <salil.mehta@...wei.com>,
        <jesse.brandeburg@...el.com>, <anthony.l.nguyen@...el.com>,
        <tariqt@...dia.com>, <saeedm@...dia.com>, <leon@...nel.org>,
        <idosch@...dia.com>, <petrm@...dia.com>, <gal@...dia.com>,
        <mailhol.vincent@...adoo.fr>
Subject: Re: [patch net-next 2/3] devlink: send objects notifications during
 devlink reload



On 1/27/2023 7:50 AM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...dia.com>
> 
> 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.
> 

Nice cleanup. Should be harder to forget notifications in the future!


Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

> Signed-off-by: Jiri Pirko <jiri@...dia.com>
> ---
>  net/devlink/leftover.c | 20 ++------------------
>  1 file 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,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ