Subject: Re: [patch net] devlink: change per-devlink netdev notifier to static one

From: Ido Schimmel <[email-masked]>
Date: Mon, 15 May 2023 15:05:54 +0300

On Mon, May 15, 2023 at 01:35:18PM +0200, Jiri Pirko wrote:
> Thanks for the report. From the first sight, don't have a clue what may
> be wrong. Debugging.

I guess he has CONFIG_NET_NS disabled which turns "__net_initdata" to
"__initdata" and frees the notifier block after init. "__net_initdata"
is a NOP when CONFIG_NET_NS is enabled.

Maybe this will help:

diff --git a/net/devlink/core.c b/net/devlink/core.c
index 0e58eee44bdb..c23ebabadc52 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -294,7 +294,7 @@ static struct pernet_operations devlink_pernet_ops __net_initdata = {
        .pre_exit = devlink_pernet_pre_exit,
 };
 
-static struct notifier_block devlink_port_netdevice_nb __net_initdata = {
+static struct notifier_block devlink_port_netdevice_nb = {
        .notifier_call = devlink_port_netdevice_event,
 };