Linux-HyperV Archive mirror
 help / color / mirror / Atom feed
From: Haiyang Zhang <haiyangz@microsoft.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	KY Srinivasan <kys@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH net,v2] hv_netvsc: fix race of netvsc and VF register_netdevice
Date: Fri, 3 Nov 2023 22:44:08 +0000	[thread overview]
Message-ID: <PH7PR21MB31169E4E03163358946BF95DCAA5A@PH7PR21MB3116.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20231101220730.2b7cc7d1@kernel.org>



> -----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


      reply	other threads:[~2023-11-03 22:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 21:22 [PATCH net,v2] hv_netvsc: fix race of netvsc and VF register_netdevice Haiyang Zhang
2023-10-27 10:21 ` Wojciech Drewek
2023-11-02  5:07 ` Jakub Kicinski
2023-11-03 22:44   ` Haiyang Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH7PR21MB31169E4E03163358946BF95DCAA5A@PH7PR21MB3116.namprd21.prod.outlook.com \
    --to=haiyangz@microsoft.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).