[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8cff200c-b944-5b05-61da-9ef5fb0dfec4@gmail.com>
Date: Fri, 20 Dec 2019 11:07:59 -0700
From: David Ahern <dsahern@...il.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, jakub.kicinski@...ronome.com,
saeedm@...lanox.com, leon@...nel.org, tariqt@...lanox.com,
ayal@...lanox.com, vladbu@...lanox.com, michaelgur@...lanox.com,
moshe@...lanox.com, mlxsw@...lanox.com
Subject: Re: [patch net-next 2/4] net: push code from net notifier reg/unreg
into helpers
On 12/20/19 5:35 AM, Jiri Pirko wrote:
> @@ -1784,6 +1784,42 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
> }
> EXPORT_SYMBOL(unregister_netdevice_notifier);
>
> +static int __register_netdevice_notifier_net(struct net *net,
> + struct notifier_block *nb,
> + bool ignore_call_fail)
> +{
> + int err;
> +
> + err = raw_notifier_chain_register(&net->netdev_chain, nb);
> + if (err)
> + return err;
> + if (dev_boot_phase)
> + return 0;
> +
> + err = call_netdevice_register_net_notifiers(nb, net);
> + if (err && !ignore_call_fail)
> + goto chain_unregister;
> +
> + return 0;
> +
> +chain_unregister:
> + raw_notifier_chain_unregister(&netdev_chain, nb);
why is the error path using the global netdev_chain when the register is
relative to a namespace? yes, I realize existing code does that and this
is maintaining that behavior.
Powered by blists - more mailing lists