hv_netvsc: Add the support of hibernation
Dexuan Cui
maintainerPATCH v2 1/1 hv_netvsc: Add the support of hibernation
The existing netvsc_detach() and netvsc_attach() APIs make it easy to implement the suspend/resume callbacks.
---
This patch is basically a pure Hyper-V specific change. I request this patch should go through Sasha's Hyper-V tree rather than the net tree.
Sasha's Hyper-V tree is here:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
Previously there was a dependency on the commit 271b2224d42f ("Drivers:
hv: vmbus: Implement suspend/resume for VSC drivers for hibernation"), which was only on Sasha Levin's Hyper-V tree's hyperv-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next
. Now the patch has been merged into Linus's master tree, but as of now, the patch (271b2224d42f) has not appeared in the net.git tree, so IMO it's better for this patch to go through the Hyper-V tree. The added code in this patch is unlikely to cause a conflict.
In v2:
Removed the superfluous "cancel_work_sync(&nvdev->subchan_work)".
Changed the [PATCH net-next] to [PATCH net] in the Subject, because IMO this is more of a bug fix rather than a new feaure.
No other change.
drivers/net/hyperv/hyperv_net.h | 3 ++ drivers/net/hyperv/netvsc_drv.c | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+)
drivers/net/hyperv/hyperv_net.h +3 -0
@@ -952,6 +952,9 @@ struct net_device_context {u32 vf_alloc;/* Serial number of the VF to team with */ u32 vf_serial; + +/* Used to temporarily save the config info across hibernation */ +struct netvsc_device_info *saved_netvsc_dev_info; };/* Per channel data */
drivers/net/hyperv/netvsc_drv.c +57 -0
69 lines not on this page · raw message
Signature · 1 line
2.19.1
Quoted 13 lines
-----Original Message-----
From: Dexuan Cui <[email protected]>
Sent: Wednesday, September 25, 2019 6:04 PM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; Michael Kelley <[email protected]>
Cc: Dexuan Cui <[email protected]>
Subject: [PATCH v2][PATCH net]hv_netvsc: Add the support of hibernation
Quoted 4 lines
The existing
netvsc_detach()andnetvsc_attach()APIs make it easy to implement the suspend/resume callbacks.Signed-off-by Dexuan Cui <[email protected]>
kbuild test robot
build botThank you for the patch! Yet something to improve:
Hi Dexuan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
url: https://github.com/0day-ci/linux/commits/Dexuan-Cui/hv_netvsc-Add-the-support-of-hibernation/20190926-061258
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 If you fix the issue, kindly add following tag
All error/warnings (new ones prefixed by >>):
>> drivers/net/hyperv/netvsc_drv.c:2486:3: error: 'struct hv_driver' has no member named 'suspend'
.suspend = netvsc_suspend,
^~~~~~~
>> drivers/net/hyperv/netvsc_drv.c:2486:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.suspend = netvsc_suspend,
^~~~~~~~~~~~~~
drivers/net/hyperv/netvsc_drv.c:2486:13: note: (near initialization for 'netvsc_drv.shutdown')
>> drivers/net/hyperv/netvsc_drv.c:2487:3: error: 'struct hv_driver' has no member named 'resume'; did you mean 'remove'?
.resume = netvsc_resume,
^~~~~~
remove
>> drivers/net/hyperv/netvsc_drv.c:2487:12: warning: excess elements in struct initializer .resume = netvsc_resume,
^~~~~~~~~~~~~
drivers/net/hyperv/netvsc_drv.c:2487:12: note: (near initialization for 'netvsc_drv')
cc1: some warnings being treated as errors
vim +2486 drivers/net/hyperv/netvsc_drv.c
2479
2480 /* The one and only one */
2481 static struct hv_driver netvsc_drv = {
2482 .name = KBUILD_MODNAME,
2483 .id_table = id_table,
2484 .probe = netvsc_probe,
2485 .remove = netvsc_remove,
> 2486 .suspend = netvsc_suspend, > 2487 .resume = netvsc_resume,
2488 .driver = {
2489 .probe_type = PROBE_FORCE_SYNCHRONOUS,
2490 },
2491 };
2492
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Dexuan Cui
maintainerQuoted 8 lines
From: [email protected] <[email protected]> On Behalf Of kbuild test robot
Sent: Thursday, September 26, 2019 9:18 PMHi Dexuan,
Thank you for the patch! Yet something to improve:
Quoted 7 lines
[auto build test ERROR on net/master]
'netvsc_drv.shutdown')
Quoted 1 line
Quoted 1 line
drivers/net/hyperv/netvsc_drv.c:2487:3: error: 'structhv_driver' has nomember named 'resume'; did you mean 'remove'?
.resume =netvsc_resume,
^~~~~~
This is a false alarm. Your code base needs to be merged with the latest Linus's tree, which has the prerequisite patch:271b2224d42f ("Drivers: hv: vmbus: Implement suspend/resume for VSC drivers for hibernation")
Thanks,
-- Dexuan
Sasha Levin
AppliedQuoted 13 lines · Haiyang Zhang
Quoted 13 lines
-----Original Message-----
From: Dexuan Cui <[email protected]>
Sent: Wednesday, September 25, 2019 6:04 PM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; Michael Kelley <[email protected]>
Cc: Dexuan Cui <[email protected]>
Subject: [PATCH v2][PATCH net]hv_netvsc: Add the support of hibernation
Quoted 6 lines
Quoted 4 lines
The existing
netvsc_detach()andnetvsc_attach()APIs make it easy to implement the suspend/resume callbacks.Signed-off-by Dexuan Cui <[email protected]>Reviewed-by Haiyang Zhang <[email protected]>
Queued up for hyperv-next, thanks!
--
Thanks,
Sasha