Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3025150ybc; Thu, 21 Nov 2019 02:07:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwfXcTGWjqr0i4sgQ8P0F5GTNHaM3H+RH8RYlAatfPjivHtY47ql2dis5+TVVbhvuh3rWcX X-Received: by 2002:a1c:a9cb:: with SMTP id s194mr9252579wme.92.1574330823258; Thu, 21 Nov 2019 02:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574330823; cv=none; d=google.com; s=arc-20160816; b=0tDBzmwiz6sUyVnQn7COEXgKtGoQoWnc8zGMa9pDfxL3P5/U4ijdsXgpG7SWn9zAYz 6Cvo8qvLomR6Fq+4Far3bT5CEyaxoPpCYRfp4BAFqzmo0KFgIq9i+r8WEpg39A4n0nIR u+QBziyo/C8Hpm0A3f0FCco8LwdBHHYA6gsrGy2o4nKvjVMhezctociD7H6kRV2MsmPv BkurMSS1w4Os/cbsSxhOxbbzUHsvkeRJEv79iUER8KAvvAd1UkGSAVilsmciiNPdKCwS yyZb2GBah6sp1RxeLQHsnQdTopz2nUx0o3OaJVGX+iRXI5RSGhNDKLyLXdqoBkDHG/aN EQsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:in-reply-to:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature; bh=mTbZEMwYfOT6jDofWQMm684EqH0d5BOVG5EfNCsfnNw=; b=fivMVB97YCf6mfnX4lAMUX3NJaVa+nXiF8y68ULhO57Jqk7VIFc7TuMJjfPPQ9oaM/ z4jnrYdDZJRW+dT4UX6nswfvEnMbw0AC1QUMS6xffExc2ePRjWsCLBLpUpN2VSAb8QwM wgQqFcX02B/9DPlFNtKnopJ2AKigFope4U9UjAIomk7VIo2QXLGLveBF9fYuVMNnr4uc 1ld4XsFO+rCjkXEDGmc6aJCacKKw1I3VGsqBvAR4dRmKTeKQjVI+bd0BsThK4VQ8WOjz Nf6U6XCRgK6RuVz+ZsTJwDpd4FYybmyYXxtMHhJEJepQF4tsQW9EHKR4vELQCUeYekoX bRwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Oa4cttyr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si1744015edx.107.2019.11.21.02.06.38; Thu, 21 Nov 2019 02:07:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Oa4cttyr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbfKUKFT (ORCPT + 99 others); Thu, 21 Nov 2019 05:05:19 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32548 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726980AbfKUKFT (ORCPT ); Thu, 21 Nov 2019 05:05:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574330717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mTbZEMwYfOT6jDofWQMm684EqH0d5BOVG5EfNCsfnNw=; b=Oa4cttyrC5mPFyptLYSY8E3nanDLM6FfEKVK1AIRnaqjzm75FWc7+44hc/Liwvp2pCpH7S YC2h2LO4CqqIrV6eEEdJquT/yFQCAHI9s+9uM043dRRzwHwbkyCMxuqz4vaQ0kb9NXPcjc J4E9hrDWilcdHEjYtZUdzpRqm4lb/DE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-Y80XKPkaO8uAJhIl728Y6w-1; Thu, 21 Nov 2019 05:05:14 -0500 Received: by mail-wr1-f69.google.com with SMTP id z10so1821611wrr.5 for ; Thu, 21 Nov 2019 02:05:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WjBe/bpFfR8YjJaRZQ403Que5OIq9zts89mo41qWm30=; b=U4kbwevrzKBRGGbvMlEcGZYkMQ3EZoE7eWrIYaFL4R+lsMZnMyG7n51uWM9/pkK949 gA18lB/aamHTdNeMfhxOfrt20Wt4cfwk0Y2G3NfTlRIP0ML7uddz62av5odQ95sIu/Sz jnx1VVua+xARGYgN1HNSi3WklRDBCbp2LBpRETLhxYpj8NlazMz4AqNm205RL7Wi00zj qzFQu4HF11i3/2X3+EyrR0nMlA0YiE5I9e4DyxFEe9Vc/oHruHt+UBJ1xEYF64iXC+l7 SYI+uTuIhVcVzDXdMfva5yNBuW6hQxcs06DU2IzXEx/yAyvZj70LMXU4iGBNQlgxyI3I LdXQ== X-Gm-Message-State: APjAAAWMdI4dKfKUkqW+Dm+h+uuJNVt0ZGmrUa6kCFdhKtqIq1RqZBH2 hOr2BeFKT9PQqgLS1gtfpqcaBKEvIGezkkDskt7wSH664xZWFAyvCw51HKtk79jD01rG1Rz58Y4 3XyHtIH+i2f9nf8iWY4B7Of5T X-Received: by 2002:a1c:7d16:: with SMTP id y22mr8565192wmc.106.1574330713222; Thu, 21 Nov 2019 02:05:13 -0800 (PST) X-Received: by 2002:a1c:7d16:: with SMTP id y22mr8565167wmc.106.1574330712947; Thu, 21 Nov 2019 02:05:12 -0800 (PST) Received: from steredhat (a-nu5-32.tin.it. [212.216.181.31]) by smtp.gmail.com with ESMTPSA id 17sm2273656wmg.19.2019.11.21.02.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 02:05:12 -0800 (PST) Date: Thu, 21 Nov 2019 11:05:10 +0100 From: Stefano Garzarella To: Stefan Hajnoczi Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Dexuan Cui , Stefan Hajnoczi , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "David S. Miller" , Jorgen Hansen Subject: Re: [PATCH net-next 0/6] vsock: add local transport support Message-ID: <20191121100510.7gdcx7c3qom2f3wo@steredhat> References: <20191119110121.14480-1-sgarzare@redhat.com> <20191121094643.GD439743@stefanha-x1.localdomain> MIME-Version: 1.0 In-Reply-To: <20191121094643.GD439743@stefanha-x1.localdomain> X-MC-Unique: Y80XKPkaO8uAJhIl728Y6w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 09:46:43AM +0000, Stefan Hajnoczi wrote: > On Tue, Nov 19, 2019 at 12:01:15PM +0100, Stefano Garzarella wrote: > > This series introduces a new transport (vsock_loopback) to handle > > local communication. > > This could be useful to test vsock core itself and to allow developers > > to test their applications without launching a VM. > >=20 > > Before this series, vmci and virtio transports allowed this behavior, > > but only in the guest. > > We are moving the loopback handling in a new transport, because it > > might be useful to provide this feature also in the host or when > > no H2G/G2H transports (hyperv, virtio, vmci) are loaded. > >=20 > > The user can use the loopback with the new VMADDR_CID_LOCAL (that > > replaces VMADDR_CID_RESERVED) in any condition. > > Otherwise, if the G2H transport is loaded, it can also use the guest > > local CID as previously supported by vmci and virtio transports. > > If G2H transport is not loaded, the user can also use VMADDR_CID_HOST > > for local communication. > >=20 > > Patch 1 is a cleanup to build virtio_transport_common without virtio > > Patch 2 adds the new VMADDR_CID_LOCAL, replacing VMADDR_CID_RESERVED > > Patch 3 adds a new feature flag to register a loopback transport > > Patch 4 adds the new vsock_loopback transport based on the loopback > > implementation of virtio_transport > > Patch 5 implements the logic to use the local transport for loopback > > communication > > Patch 6 removes the loopback from virtio_transport > >=20 > > @Jorgen: Do you think it might be a problem to replace > > VMADDR_CID_RESERVED with VMADDR_CID_LOCAL? > >=20 > > Thanks, > > Stefano > >=20 > > Stefano Garzarella (6): > > vsock/virtio_transport_common: remove unused virtio header includes > > vsock: add VMADDR_CID_LOCAL definition > > vsock: add local transport support in the vsock core > > vsock: add vsock_loopback transport > > vsock: use local transport when it is loaded > > vsock/virtio: remove loopback handling > >=20 > > MAINTAINERS | 1 + > > include/net/af_vsock.h | 2 + > > include/uapi/linux/vm_sockets.h | 8 +- > > net/vmw_vsock/Kconfig | 12 ++ > > net/vmw_vsock/Makefile | 1 + > > net/vmw_vsock/af_vsock.c | 49 +++++- > > net/vmw_vsock/virtio_transport.c | 61 +------ > > net/vmw_vsock/virtio_transport_common.c | 3 - > > net/vmw_vsock/vmci_transport.c | 2 +- > > net/vmw_vsock/vsock_loopback.c | 217 ++++++++++++++++++++++++ > > 10 files changed, 283 insertions(+), 73 deletions(-) > > create mode 100644 net/vmw_vsock/vsock_loopback.c >=20 > Please see my comments. Otherwise: >=20 > Reviewed-by: Stefan Hajnoczi Thanks! I'll send a v2 following your comments. Stefano