[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200906092621.72005293@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Sun, 6 Sep 2020 09:26:21 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Dexuan Cui <decui@...rosoft.com>
Cc: "wei.liu@...nel.org" <wei.liu@...nel.org>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michael Kelley <mikelley@...rosoft.com>
Subject: Re: [PATCH net] hv_netvsc: Fix hibernation for mlx5 VF driver
On Sun, 6 Sep 2020 03:05:48 +0000 Dexuan Cui wrote:
> > > @@ -2635,6 +2632,10 @@ static int netvsc_resume(struct hv_device *dev)
> > > netvsc_devinfo_put(device_info);
> > > net_device_ctx->saved_netvsc_dev_info = NULL;
> > >
> > > + vf_netdev = rtnl_dereference(net_device_ctx->vf_netdev);
> > > + if (vf_netdev && netvsc_vf_changed(vf_netdev) != NOTIFY_OK)
> > > + ret = -EINVAL;
> >
> > Should you perhaps remove the VF in case of the failure?
> IMO this failure actually should not happen since we're resuming the netvsc
> NIC, so we're sure we have a valid pointer to the netvsc net device, and
> netvsc_vf_changed() should be able to find the netvsc pointer and return
> NOTIFY_OK. In case of a failure, something really bad must be happening,
> and I'm not sure if it's safe to simply remove the VF, so I just return
> -EINVAL for simplicity, since I believe the failure should not happen in practice.
Okay, I see that the errors propagated by netvsc_vf_changed() aren't
actually coming from netvsc_switch_datapath(), so you're right. The
failures here won't be meaningful.
> I would rather keep the code as-is, but I'm OK to add a WARN_ON(1) if you
> think that's necessary.
No need, I think core will complain when resume callback fails. That
should be sufficient.
Powered by blists - more mailing lists