Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbdHRPua (ORCPT ); Fri, 18 Aug 2017 11:50:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60610 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbdHRPu1 (ORCPT ); Fri, 18 Aug 2017 11:50:27 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A8453C0587D7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=stefanha@redhat.com Date: Thu, 17 Aug 2017 15:55:51 +0100 From: Stefan Hajnoczi To: Dexuan Cui Cc: "davem@davemloft.net" , "netdev@vger.kernel.org" , "devel@linuxdriverproject.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , George Zhang , Jorgen Hansen , Michal Kubecek , Vitaly Kuznetsov , Cathy Avery , "jasowang@redhat.com" , Rolf Neugebauer , Dave Scott , Marcelo Cerri , "apw@canonical.com" , "olaf@aepfle.de" , "joe@perches.com" , "linux-kernel@vger.kernel.org" , Dan Carpenter Subject: Re: [PATCH net-next 3/3] hv_sock: implements Hyper-V transport for Virtual Sockets (AF_VSOCK) Message-ID: <20170817145551.GI5539@stefanha-x1.localdomain> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0NB0lE7sNnW8+0qW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 18 Aug 2017 15:50:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 54 --0NB0lE7sNnW8+0qW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 15, 2017 at 10:18:41PM +0000, Dexuan Cui wrote: > +static u32 hvs_get_local_cid(void) > +{ > + return VMADDR_CID_ANY; > +} Interesting concept: the guest never knows its CID. This is nice from a live migration perspective. Currently VMCI and virtio adjust listen socket local CIDs after migration. > +static bool hvs_stream_allow(u32 cid, u32 port) > +{ > + static const u32 valid_cids[] = { > + VMADDR_CID_ANY, Is this for loopback? > + VMADDR_CID_HOST, > + }; > + int i; > + > + /* The host's port range [MIN_HOST_EPHEMERAL_PORT, 0xFFFFFFFF) is > + * reserved as ephemeral ports, which are used as the host's ports > + * when the host initiates connections. > + */ > + if (port > MAX_HOST_LISTEN_PORT) > + return false; Without this if statement the guest will attempt to connect. I guess there will be no listen sockets above MAX_HOST_LISTEN_PORT, so the connection attempt will fail. ...but hardcode this knowledge into the guest driver? --0NB0lE7sNnW8+0qW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJZla53AAoJEJykq7OBq3PIeC4H/j9lwEAGG0SNo0QPMTc/1GPJ GAr3FlH8SyOKRETQA8LLOXM1WQM3QShqSDrl1Y37vi5IJL/VmYEJOcEBfq3EG8Ck XPChqNq+0cp8bMRNWeLLpykzdHsato6vdO1bNr31AaFr+anH1eS6YnGmVU3DBzSd HgCsm1q0vOL+MpGBZ7JnXkJloPSBFw3hlhBi3ccMVTxfp8qESPzjDupuYydEh086 /FxXHrbNnuQEkdiMZlo2tH+qCS/TaGE4ZVYmwVlxDdQ8EH8emPHkak+V8VZy6sT9 yASd50ogJmW1CMaaHLlpSf1gewI2ek+SzymXoNqhMWLqukq2IoIeqZOtODm2o/o= =p8P2 -----END PGP SIGNATURE----- --0NB0lE7sNnW8+0qW--