Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbbLXMiZ (ORCPT ); Thu, 24 Dec 2015 07:38:25 -0500 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:55478 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbbLXMiL (ORCPT ); Thu, 24 Dec 2015 07:38:11 -0500 x-originating-ip: 72.167.245.219 From: Dexuan Cui To: gregkh@linuxfoundation.org, davem@davemloft.net, stephen@networkplumber.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, kys@microsoft.com Cc: pebolle@tiscali.nl, stefanha@redhat.com, vkuznets@redhat.com, dan.carpenter@oracle.com Subject: [PATCH V5 0/9] introduce Hyper-V VM Sockets(hvsock Date: Thu, 24 Dec 2015 06:12:23 -0800 Message-Id: <1450966343-13035-1-git-send-email-decui@microsoft.com> X-Mailer: git-send-email 1.7.4.1 X-CMAE-Envelope: MS4wfAyUzWjc3bZs/it67frJnL4mhMjzbkF+cO4XihuHkxdgPkv5zTrU/QOePEsx50aKqRVOKuB/Q2Du48lgsPS8wrrhYMISroyg5BXNwiAw7+AqWmZIDpmO s4zKd5JkcQrnxtmfCw5UvoCl2IuMQUW6w6i3CzbhSefL+aw+8vIC/HiKzswuUWNZK5f+lges218FWatcXJ1O/arS+62ud98Ae6l+g+06Z/RlaopOHupMR/6b Tvr9yubqCj2MNpiB7n8cVtNLUmUU924FW0DpLnY6RKvb6HfID8jcZTOxj6BPYcTImh+UWsoa/0bBcRRH2xDLQo/373WOU7b2Bl1V83clTy1t/CTX5y9Q7abN mpfxLSiuLvmx1qpD1d+7j3zjn+q1Y0uLvpjoDkwg/0BJDpniWs21J9GpLfi4enJ7q2YQXVuXPgDyAqztx7eIK6/mr+r5Bg0v50MrcYiFxhh1QaS0F82Nd6vB DxxrMY3p6uiv7k9eikrPnQdjXJo7OcghNc7cxwQx5HF60TpRgjfPuTmsRyNvHAuo0WKBV5sWKc/7pFD5WVrnLrFGtwr4Wy15I/BQkdzOjA44tafNVDphRHTr NZfXHoDMjLwnqBxEHdXkHbMyVWUItpn4AhnNXXfBFuasiw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4715 Lines: 118 Merry Christmas, everyone! 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" - MODULE_LICENSE: "Dual MIT/GPL" -> "Dual BSD/GPL" 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. - EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL 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() Changes since v4 (https://lkml.org/lkml/2015/7/28/404): - addressed all the comments about V4. - treat the hvsock offers/channels as special VMBus devices - add a mechanism to pass hvsock events to the hvsock driver - fixed some corner cases with proper locking when a connection is closed - rebased to the latest Greg's tree 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: http://thread.gmane.org/gmane.linux.network/365205. 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: , but in AF_HYPERV, the endpoint type is: . 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, SO_VM_SOCKETS_BUFFER_MIN/MAX_SIZE and SO_VM_SOCKETS_CONNECT_TIMEOUT. These are meaningless to AF_HYPERV. 4. Some AF_VSOCK's VMCI transportation ops are meanless to AF_HYPERV/VMBus, like .notify_recv_init .notify_recv_pre_block .notify_recv_pre_dequeue .notify_recv_post_dequeue .notify_send_init .notify_send_pre_block .notify_send_pre_enqueue .notify_send_post_enqueue etc. So I think we'd better introduce a new address family: AF_HYPERV. Please review the patchset. Looking forward to your comments! Dexuan Cui (9): Drivers: hv: vmbus: add a helper function to set a channel's pending send size Drivers: hv: vmbus: define the new offer type for Hyper-V socket (hvsock) Drivers: hv: vmbus: define a new VMBus message type for hvsock Drivers: hv: ring_buffer: enhance hv_ringbuffer_read() to support hvsock Drivers: hv: vmbus: add APIs to send/recv hvsock packets Drivers: hv: vmbus: add a hvsock flag in struct hv_driver Drivers: hv: vmbus: add a mechanism to pass hvsock events to the hvsock driver Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister() hvsock: introduce Hyper-V VM Sockets feature MAINTAINERS | 2 + drivers/hv/channel.c | 84 ++- drivers/hv/channel_mgmt.c | 53 +- drivers/hv/connection.c | 4 +- drivers/hv/hyperv_vmbus.h | 13 +- drivers/hv/ring_buffer.c | 54 +- drivers/hv/vmbus_drv.c | 4 + include/linux/hyperv.h | 88 +++ 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 | 1473 +++++++++++++++++++++++++++++++++++++++++++ 16 files changed, 1830 insertions(+), 24 deletions(-) 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 -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/