Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] hv_sock: Add the support of hibernation
@ 2019-09-25 21:34 Dexuan Cui
  2019-09-27  4:18 ` kbuild test robot
  2019-10-01 18:42 ` Sasha Levin
  0 siblings, 2 replies; 4+ messages in thread
From: Dexuan Cui @ 2019-09-25 21:34 UTC (permalink / raw)
  To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, sashal, davem,
	linux-hyperv, netdev, linux-kernel, Michael Kelley
  Cc: Dexuan Cui

Add the necessary dummy callbacks for hibernation.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Acked-by: David S. Miller <davem@davemloft.net>
---

In v2:
    Added David's Acked-by.
    Removed [net-next] from the Subject.

    @Sasha, can you please pick this up into the hyper-v tree?

 net/vmw_vsock/hyperv_transport.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index f2084e3f7aa4..4c02e38aa728 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -930,6 +930,24 @@ static int hvs_remove(struct hv_device *hdev)
 	return 0;
 }
 
+/* hv_sock connections can not persist across hibernation, and all the hv_sock
+ * channels are forced to be rescinded before hibernation: see
+ * vmbus_bus_suspend(). Here the dummy hvs_suspend() and hvs_resume()
+ * are only needed because hibernation requires that every vmbus device's
+ * driver should have a .suspend and .resume callback: see vmbus_suspend().
+ */
+static int hvs_suspend(struct hv_device *hv_dev)
+{
+	/* Dummy */
+	return 0;
+}
+
+static int hvs_resume(struct hv_device *dev)
+{
+	/* Dummy */
+	return 0;
+}
+
 /* This isn't really used. See vmbus_match() and vmbus_probe() */
 static const struct hv_vmbus_device_id id_table[] = {
 	{},
@@ -941,6 +959,8 @@ static struct hv_driver hvs_drv = {
 	.id_table	= id_table,
 	.probe		= hvs_probe,
 	.remove		= hvs_remove,
+	.suspend	= hvs_suspend,
+	.resume		= hvs_resume,
 };
 
 static int __init hvs_init(void)
-- 
2.19.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] hv_sock: Add the support of hibernation
  2019-09-25 21:34 [PATCH v2] hv_sock: Add the support of hibernation Dexuan Cui
@ 2019-09-27  4:18 ` kbuild test robot
  2019-09-27  4:40   ` Dexuan Cui
  2019-10-01 18:42 ` Sasha Levin
  1 sibling, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2019-09-27  4:18 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: kbuild-all, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	sashal, davem, linux-hyperv, netdev, linux-kernel,
	Michael Kelley, Dexuan Cui

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

Hi Dexuan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[cannot apply to v5.3 next-20190925]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dexuan-Cui/hv_sock-Add-the-support-of-hibernation/20190926-053950
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
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> net//vmw_vsock/hyperv_transport.c:970:3: error: 'struct hv_driver' has no member named 'suspend'
     .suspend = hvs_suspend,
      ^~~~~~~
>> net//vmw_vsock/hyperv_transport.c:970:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .suspend = hvs_suspend,
                ^~~~~~~~~~~
   net//vmw_vsock/hyperv_transport.c:970:13: note: (near initialization for 'hvs_drv.shutdown')
>> net//vmw_vsock/hyperv_transport.c:971:3: error: 'struct hv_driver' has no member named 'resume'; did you mean 'remove'?
     .resume  = hvs_resume,
      ^~~~~~
      remove
>> net//vmw_vsock/hyperv_transport.c:971:13: warning: excess elements in struct initializer
     .resume  = hvs_resume,
                ^~~~~~~~~~
   net//vmw_vsock/hyperv_transport.c:971:13: note: (near initialization for 'hvs_drv')
   cc1: some warnings being treated as errors

vim +970 net//vmw_vsock/hyperv_transport.c

   963	
   964	static struct hv_driver hvs_drv = {
   965		.name		= "hv_sock",
   966		.hvsock		= true,
   967		.id_table	= id_table,
   968		.probe		= hvs_probe,
   969		.remove		= hvs_remove,
 > 970		.suspend	= hvs_suspend,
 > 971		.resume		= hvs_resume,
   972	};
   973	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48067 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] hv_sock: Add the support of hibernation
  2019-09-27  4:18 ` kbuild test robot
@ 2019-09-27  4:40   ` Dexuan Cui
  0 siblings, 0 replies; 4+ messages in thread
From: Dexuan Cui @ 2019-09-27  4:40 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	sashal, davem, linux-hyperv, netdev, linux-kernel,
	Michael Kelley

> From: linux-hyperv-owner@vger.kernel.org
> <linux-hyperv-owner@vger.kernel.org> On Behalf Of kbuild test robot
> Sent: Thursday, September 26, 2019 9:19 PM
> 
> Hi Dexuan,
> 
> Thank you for the patch! Yet something to improve:
> 
> >> net//vmw_vsock/hyperv_transport.c:970:3: error: 'struct hv_driver' has no
> member named 'suspend'
>      .suspend = hvs_suspend,
>       ^~~~~~~

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] hv_sock: Add the support of hibernation
  2019-09-25 21:34 [PATCH v2] hv_sock: Add the support of hibernation Dexuan Cui
  2019-09-27  4:18 ` kbuild test robot
@ 2019-10-01 18:42 ` Sasha Levin
  1 sibling, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2019-10-01 18:42 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, davem,
	linux-hyperv, netdev, linux-kernel, Michael Kelley

On Wed, Sep 25, 2019 at 09:34:13PM +0000, Dexuan Cui wrote:
>Add the necessary dummy callbacks for hibernation.
>
>Signed-off-by: Dexuan Cui <decui@microsoft.com>
>Acked-by: David S. Miller <davem@davemloft.net>

Queued up for hyperv-next, thanks!

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 21:34 [PATCH v2] hv_sock: Add the support of hibernation Dexuan Cui
2019-09-27  4:18 ` kbuild test robot
2019-09-27  4:40   ` Dexuan Cui
2019-10-01 18:42 ` Sasha Levin

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git