-----Original Message----- From: Jakub Kicinski kuba@kernel.org Sent: Thursday, November 2, 2023 1:08 AM To: Haiyang Zhang haiyangz@microsoft.com Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; KY Srinivasan kys@microsoft.com; wei.liu@kernel.org; Dexuan Cui decui@microsoft.com; edumazet@google.com; pabeni@redhat.com; davem@davemloft.net; linux-kernel@vger.kernel.org; stable@vger.kernel.org Subject: Re: [PATCH net,v2] hv_netvsc: fix race of netvsc and VF register_netdevice
On Thu, 26 Oct 2023 14:22:34 -0700 Haiyang Zhang wrote:
And, move register_netdevice_notifier() earlier, so the call back function is set before probing.
Are you sure you need this? I thought the netdev notifier "replays" registration events (i.e. sends "fake" events for already present netdevs).
If I'm wrong this should still be a separate patch from the rtnl reorder.
I tested, NETDEV_REGISTER is indeed replayed, but NETDEV_POST_INIT is not. And we will use NETDEV_POST_INIT soon.
Also, we want to get notified by NETDEV_POST_INIT immediately from VF, before VF NIC shows up to upper layers. So, even if we make NETDEV_POST_INIT to be replayed, that may be too late.
I will put the register_netdevice_notifier() change to a separate patch.
Thanks, - Haiyang