Subject: Re: [patch net-next RFC 7/7] devlink: assert if devl_port_register/unregister() is called on unregistered devlink instance

From: Leon Romanovsky <[email-masked]>
Date: Sun, 4 Dec 2022 13:40:09 +0200

On Thu, Dec 01, 2022 at 05:46:08PM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <[email-masked]>
> 
> Now when all drivers do call devl_port_register/unregister() withing the
> time frame during which the devlink is registered, put and assertion to
> the functions to check that and avoid going back.
> 
> Signed-off-by: Jiri Pirko <[email-masked]>
> ---
>  net/core/devlink.c | 2 ++
>  1 file changed, 2 insertions(+)

You also need to remove delayed notifications from devlink_notify_register()

   9862         xa_for_each(&devlink->ports, port_index, devlink_port)
   9863                 devlink_port_notify(devlink_port, DEVLINK_CMD_PORT_NEW);

Thanks