Skip to contentSkip to conversation

hv_netvsc: Add the support of hibernation

PATCH Applied Dexuan Cui 4 participants 5 messages Sep 25, 2019 – Oct 1, 2019

Subsystems (4)

v2 of 4 Applied Latest is v4 →

lore
Share & tools
lore

Dexuan Cui

author maintainer
#0 lore raw

PATCH 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
index ecc9af050387..b8763ee4c0d0 100644
@@ -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
maintainer Reviewed-by on v2 1/1
#1 lore raw
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() and netvsc_attach() APIs make it easy to implement the suspend/resume callbacks.

Applied
#2 lore raw
Quoted 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() and netvsc_attach() APIs make it easy to implement the suspend/resume callbacks.

Queued up for hyperv-next, thanks!

--
Thanks,
Sasha

#3 lore raw
In reply to Dexuan Cui
Thank 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

author maintainer
#4 lore raw
Quoted 8 lines

From: [email protected] <[email protected]> On Behalf Of kbuild test robot
Sent: Thursday, September 26, 2019 9:18 PM

Hi 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: 'struct hv_driver' has no

member 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