[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<SN6PR2101MB0943E6D0DB9E9D7906FDD54DCA57A@SN6PR2101MB0943.namprd21.prod.outlook.com>
Date: Tue, 15 Jul 2025 15:49:52 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Jakub Kicinski <kuba@...nel.org>, Haiyang Zhang
<haiyangz@...ux.microsoft.com>
CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, KY Srinivasan
<kys@...rosoft.com>, "wei.liu@...nel.org" <wei.liu@...nel.org>, Dexuan Cui
<decui@...rosoft.com>, "edumazet@...gle.com" <edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>, "stephen@...workplumber.org"
<stephen@...workplumber.org>, "davem@...emloft.net" <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [EXTERNAL] Re: [PATCH net] hv_netvsc: Switch VF namespace in
netvsc_open instead
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Monday, July 14, 2025 9:29 PM
> To: Haiyang Zhang <haiyangz@...ux.microsoft.com>
> Cc: linux-hyperv@...r.kernel.org; netdev@...r.kernel.org; Haiyang Zhang
> <haiyangz@...rosoft.com>; KY Srinivasan <kys@...rosoft.com>;
> wei.liu@...nel.org; Dexuan Cui <decui@...rosoft.com>; edumazet@...gle.com;
> pabeni@...hat.com; stephen@...workplumber.org; davem@...emloft.net; linux-
> kernel@...r.kernel.org; stable@...r.kernel.org
> Subject: [EXTERNAL] Re: [PATCH net] hv_netvsc: Switch VF namespace in
> netvsc_open instead
>
> On Fri, 11 Jul 2025 13:57:10 -0700 Haiyang Zhang wrote:
> > The existing code move the VF NIC to new namespace when NETDEV_REGISTER
> is
> > received on netvsc NIC. During deletion of the namespace,
> > default_device_exit_batch() >> default_device_exit_net() is called. When
> > netvsc NIC is moved back and registered to the default namespace, it
> > automatically brings VF NIC back to the default namespace. This will
> cause
> > the default_device_exit_net() >> for_each_netdev_safe loop unable to
> detect
> > the list end, and hit NULL ptr:
>
> Are you saying that when netns is dismantled both devices are listed
> for moving back to default, but the netvsc_event_set_vf_ns() logic
> tries to undo the move / move the VF before the netns dismantle loop
> got to it?
netvsc_event_set_vf_ns() moves the VF to default ns before the netns
dismantle loop got to it, and causes the Null prt error.
> This needs a better fix, moving on open is way too hacky.
> Perhaps we should start with reverting 4c262801ea60 and then trying
> to implement it in a more robust way?
This patch reverts the 4c262801ea60, and moves the logic to netvsc_open().
I was thinking some other ways too... But seems I couldn't find a way
to know it's in the for_each_netdev_safe loop, and to skip moving the
VF in netvsc_event_set_vf_ns() this case.
Thanks,
- Haiyang
Powered by blists - more mailing lists