Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756323AbbGQGJ4 (ORCPT ); Fri, 17 Jul 2015 02:09:56 -0400 Received: from mail-by2on0113.outbound.protection.outlook.com ([207.46.100.113]:28360 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752113AbbGQGJy convert rfc822-to-8bit (ORCPT ); Fri, 17 Jul 2015 02:09:54 -0400 X-Greylist: delayed 1977 seconds by postgrey-1.27 at vger.kernel.org; Fri, 17 Jul 2015 02:09:54 EDT Authentication-Results: spf=pass (sender IP is 206.191.229.116) smtp.mailfrom=microsoft.com; redhat.com; dkim=none (message not signed) header.d=none; From: Dexuan Cui To: Stefan Hajnoczi CC: "gregkh@linuxfoundation.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "driverdev-devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , KY Srinivasan , Haiyang Zhang Subject: RE: [PATCH 0/7] introduce Hyper-V VM Sockets(hvsock) Thread-Topic: [PATCH 0/7] introduce Hyper-V VM Sockets(hvsock) Thread-Index: AQHQv+BYqnC0T5J8qUSfJZ7CXmXylJ3fIPTg Date: Fri, 17 Jul 2015 05:36:47 +0000 Message-ID: References: <1436193575-26674-1-git-send-email-decui@microsoft.com> <20150716155859.GA29366@stefanha-thinkpad.redhat.com> In-Reply-To: <20150716155859.GA29366@stefanha-thinkpad.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.251.57.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD007;1:jsWv56hISmJBIhxSjpRFZ5AYOm4CDqYp/pCLmMzzXQe9qzTZHOJ7XxI0Hsihk8VeuSqYhmKT78wcdEUHshwHLThM+AIJ9VZmFyDuUM1NEs1fudOm1xt+EjddJYcoaG3i5DCbdCU4EUo3QwNoZBl2Ch2Mh/h4x04k6h/MSW9ZYfAffP6tkbZ+aga+GRYNKQyBOf9QTvaQLCH2Orbnh+YXc8WiKMWnNJEk7dhQdYTDcuBXDMHZ27uHIgjyDsLoY/nDYCc5FyxKCG2OdzL8wYgGBHUxwAam5XAjKvyLsxwl6chlDYNJAxLILxlA0xXXxxGbe/Ml+Z9RnFhXon82rgTKUiHDzaRCEIz86L0BWIRZU8juv6F+2VNAhfzd3AbObnal X-Forefront-Antispam-Report: CIP:206.191.229.116;CTRY:US;IPV:CAL;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(438002)(189002)(199003)(13464003)(51914003)(24454002)(102836002)(15975445007)(2900100001)(2950100001)(106116001)(106466001)(24736003)(62966003)(77156002)(92566002)(5001960100002)(189998001)(50466002)(110136002)(107886002)(6806004)(19580395003)(66066001)(86612001)(33646002)(97756001)(86362001)(87936001)(54356999)(76176999)(50986999)(23726002)(16796002)(86146001)(108616004)(5003600100002)(2656002)(46102003)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB068;H:064-smtp-out.microsoft.com;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB068;2:tycNtAu1k0VvcCD4anaPR40XGXNnMcHDt2Ap/r9FSZSaLW255WGGEI0944vvKOOJ;3:MwL1D4HxNq7mtGJjLLPHShYlQpt6MXTMSysrseA+tQmrMSr8XKRRmwK58Hg5XswkQON+ZGu2stauo71aNWcYLHO1JyQdItDn3jJ5YS2qwq2Dm9jAZySO+mt52irmJIElt73RbypG6M5HksoQbcC07lWcyb4SoAKUG7UP4+pnD3kW2ijCwJr6/l9rZjoe+T4wmjuumxOljPWFIWNcd6poNAdr3YyfrBRFZ0Crw91LyzpJqCj4YutiaMwA2Ze2/Fb3;25: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XY4KJtsS4lJ8+zzkDbm14tviiOK4V5be4r0IouT2KsU31I9iXytGita6dNxO9GsAy9MaeAFml8nTtptMKzJNXX8yvEdr/kLnm+yvytr2c7hXfXqysmpcfuP2YJGKyMaU6 BLUPR03MB068: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401001)(5005006)(3002001);SRVR:BLUPR03MB068;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB068; X-Forefront-PRVS: 06400060E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB068;23:A+MB6L53RJOkxGRMBZW7GfiXRIuPFyDRuF5hhygJMY?= =?us-ascii?Q?EztDHiL8NXwIgieD8s1jTiKZ0DXZYHBGooICCiCbwObxaH/yh+Z0yym6ZvoP?= =?us-ascii?Q?pTNIgTgu0gcERIhSjZH7xJYmVVDA1y99Qajwd5jsYGi7SJ7I5L+LioBBOgSe?= =?us-ascii?Q?nWSzj99LqTtOU2Dx+xOi69u+q3gIrkhVVqSH2vwDFWyACDGa7HKQbya/br9R?= =?us-ascii?Q?9zzeelbGeYdV84uAkK/ajWAULNQFWzwL6IrYFgd7z/vF881ssNpBiO7u9ck5?= =?us-ascii?Q?3430Ya5H+dDR7dt3QxUNUhE8nGzQRnjgi4zgJllz7RaxW+AQsl2xGF3BJhnh?= =?us-ascii?Q?FphThgLH4ucFT+UsrUve1GN9fwcbeJ1HyIvb48P5hpBU2qFNcxY8lGtiX4cW?= =?us-ascii?Q?NfAL9HUcaknxt7oLPFHjkOYx8q2Ch6XBcMAsFudZ6GwPPY84KoRnuicIikr8?= =?us-ascii?Q?WTcPGsCB+seRLA2FOwS1ZAZez4rH32AdADkuDf5L0dmSY7y8Wb03TSTR0wOI?= =?us-ascii?Q?zH0dkdjro6XDgRdE71GgzJlwh1eKuN9E//zsS4tjUQ8t+TyKLKYTVdPeacLp?= =?us-ascii?Q?bLJ92kOr/0Q83PtDhqXZQrFBAX+Hepw5rDeNVBVnZae/Cy0cSP+A9JyOIwrY?= =?us-ascii?Q?B0jLBpdGh98d636ln/Ui8k0RZ2gstIsQYQxhK8WVa4aZwRUe+fq4bJlbv4fA?= =?us-ascii?Q?2RLU0S9D63hCe5xsCbb2q+NeGRYtA2tjP5eSH+qTVKWBcq11ChWuei3t81io?= =?us-ascii?Q?EhObOvjhmR8PEkjrsMtdUFSr/tX/7hfM7SOeVJof/P4FQd4yDmQP+ZI1nMA6?= =?us-ascii?Q?44VSHPOMis8AGYylBBL3pq5MMnmU5eWjIpxc0GIx3glQFlYz2bKLL+awLhEg?= =?us-ascii?Q?ORHy5cVbrxusndgNmrjId1sJ1+FyecJdhnBnv8uyNucuxzCmiJLCMxbvP8i7?= =?us-ascii?Q?bDgEM6i6FJGDK7plcTiY6mdsYRdDBQuN9Ulf2X5ZP2fZ8uJuC12SpPKA3r7A?= =?us-ascii?Q?oe36TvYbIav0tno//2/CO22bltalggorlczQAt4hw6FrqZekCYBAM+eaaFUG?= =?us-ascii?Q?9A5qtCAJ+64u2cNL6psQAEcAPZ?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB068;5:Hw+oZ3DN14rSih7Y4d3i8gzWVDZpjFh8uDMq5f5VcSE+q+MDtOQGV1+JbO57Q7veXYYhXJqSM6FAyseq5PGvnjdsPsf8TX6A7UfOEcP6vpa9YlX6i1b8AntZ+bnA92CcBeQvouhv3nLWHZ/MYZ4jqg==;24:vfF4R0gyhJKU0vrF0FWK3t/mSEYED0OQvJdx6y+9TUo9okDlb4yCzfRuCOLKVE0WfrapAab/t455xDus60h1Ade8BsW+uP7JyjZ2FWWCtsk=;20:l85BC4Ba8hj/jaIPGQltuoSNIpcDUl+P+YMHeVZlGOselbLUD5wVJu9uLoAWt1CVJQVRCB4XVavY5kp/BHgxPg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2015 05:36:54.0246 (UTC) X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;Ip=[206.191.229.116];Helo=[064-smtp-out.microsoft.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB068 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3572 Lines: 92 > -----Original Message----- > From: Stefan Hajnoczi > Sent: Thursday, July 16, 2015 23:59 > On Mon, Jul 06, 2015 at 07:39:35AM -0700, Dexuan Cui wrote: > > 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. > > Points 2-4 are not critical. I think there are solutions to them. > > Point 1 is the main issue: hvsock has addresses instead of > vsock's addresses. Perhaps a mapping could be used but that > is pretty ugly. Hi Stefan, Exactly! In the current AF_VSOCK code and the related transport layer (the wrapper ops of VMware's VMCI), the endpoint is widely used by "struct sockaddr_vm" (this struct is exported to the user space). So, anyway, the user space application has to explicitly handle the different endpoint sizes. And in the driver side, IMO there is no way to reuse the code of AF_VSOCK with clean changes. > One idea is something like a userspace <-> > lookup function that applications can use if they want to > accept GUIDs. Thanks for the suggestion! While this is technically possible, IMO it would mess up the driver side's AF_VSOCK code: in many places, we'll have to add ugly code like: IF the endpoint size is THEN use the existing logic; ELSE use the new logic; > I don't have a workable alternative to propose, so I agree that a new > address family is justified. Thanks for your exact understanding! :-) -- Dexuan -- 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/