Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: "wei.liu@kernel.org" <wei.liu@kernel.org>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Michael Kelley <mikelley@microsoft.com>
Subject: Re: [PATCH net] hv_netvsc: Fix hibernation for mlx5 VF driver
Date: Sun, 6 Sep 2020 09:26:21 -0700 [thread overview]
Message-ID: <20200906092621.72005293@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <KU1P153MB012097D6AA971EC957D854B2BF2B0@KU1P153MB0120.APCP153.PROD.OUTLOOK.COM>
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.
prev parent reply other threads:[~2020-09-06 16:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-05 2:52 Dexuan Cui
2020-09-05 23:27 ` Jakub Kicinski
2020-09-06 3:05 ` Dexuan Cui
2020-09-06 16:26 ` Jakub Kicinski [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=20200906092621.72005293@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@microsoft.com \
--cc=wei.liu@kernel.org \
--subject='Re: [PATCH net] hv_netvsc: Fix hibernation for mlx5 VF driver' \
/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
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 NNTP newsgroup(s).