[lkml]   [2015]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v4 0/7] introduce Hyper-V VM Sockets(hvsock)

Changes since v1:
- updated "[PATCH 6/7] hvsock: introduce Hyper-V VM Sockets feature"
- added __init and __exit for the module init/exit functions
- net/hv_sock/Kconfig: "default m" -> "default m if HYPERV"

Changes since v2:
- fixed various coding issue pointed out by David Miller
- fixed indentation issues
- removed pr_debug in net/hv_sock/af_hvsock.c
- used reverse-Chrismas-tree style for local variables.

Changes since v3:
- fixed a few coding issue pointed by Vitaly Kuznetsov and Dan Carpenter
- fixed the ret value in vmbus_recvpacket_hvsock on error
- fixed the style of multi-line comment: vmbus_get_hvsock_rw_status()

Hyper-V VM Sockets (hvsock) is a byte-stream based communication mechanism
between Windowsd 10 (or later) host and a guest. It's kind of TCP over
VMBus, but the transportation layer (VMBus) is much simpler than IP.
With Hyper-V VM Sockets, applications between the host and a guest can
talk with each other directly by the traditional BSD-style socket APIs.

The patchset implements the necessary support in the guest side by adding
the necessary new APIs in the vmbus driver, and introducing a new driver
hv_sock.ko, which implements_a new socket address family AF_HYPERV.

I know the kernel has already had a VM Sockets driver (AF_VSOCK) based
on VMware's VMCI (net/vmw_vsock/, drivers/misc/vmw_vmci), and KVM is
proposing AF_VSOCK of virtio version:

However, though Hyper-V VM Sockets may seem conceptually similar to
AF_VOSCK, there are differences in the transportation layer, and IMO these
make the direct code reusing impractical:

1. In AF_VSOCK, the endpoint type is: <u32 ContextID, u32 Port>, but in
AF_HYPERV, the endpoint type is: <GUID VM_ID, GUID ServiceID>. Here GUID
is 128-bit.

2. AF_VSOCK supports SOCK_DGRAM, while AF_HYPERV doesn't.

3. AF_VSOCK supports some special sock opts, like SO_VM_SOCKETS_BUFFER_SIZE,
These are meaningless to AF_HYPERV.

4. Some AF_VSOCK's VMCI transportation ops are meanless to AF_HYPERV/VMBus,
like .notify_recv_init

So I think we'd better introduce a new address family: AF_HYPERV.

Please review the patchset.

Looking forward to your comments!
Dexuan Cui (7):
Drivers: hv: vmbus: define the new offer type for Hyper-V socket
Drivers: hv: vmbus: define a new VMBus message type for hvsock
Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the
Drivers: hv: vmbus: add APIs to register callbacks to process hvsock
Drivers: hv: vmbus: add a helper function to set a channel's pending
send size
hvsock: introduce Hyper-V VM Sockets feature
Drivers: hv: vmbus: disable local interrupt when hvsock's callback is

drivers/hv/Makefile | 4 +-
drivers/hv/channel.c | 149 +++++
drivers/hv/channel_mgmt.c | 13 +
drivers/hv/connection.c | 15 +-
drivers/hv/hvsock_callbacks.c | 71 ++
drivers/hv/hyperv_vmbus.h | 4 +
drivers/hv/ring_buffer.c | 14 +
include/linux/hyperv.h | 68 ++
include/linux/socket.h | 4 +-
include/net/af_hvsock.h | 44 ++
include/uapi/linux/hyperv.h | 16 +
net/Kconfig | 1 +
net/Makefile | 1 +
net/hv_sock/Kconfig | 10 +
net/hv_sock/Makefile | 3 +
net/hv_sock/af_hvsock.c | 1430 +++++++++++++++++++++++++++++++++++++++++
17 files changed, 1846 insertions(+), 3 deletions(-)
create mode 100644 drivers/hv/hvsock_callbacks.c
create mode 100644 include/net/af_hvsock.h
create mode 100644 net/hv_sock/Kconfig
create mode 100644 net/hv_sock/Makefile
create mode 100644 net/hv_sock/af_hvsock.c


 \ /
  Last update: 2015-07-28 13:41    [W:0.233 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site