Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp693154ybp; Wed, 9 Oct 2019 02:45:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqztKu/X/S59xcLK0iTrlHez0WUS/GAq7//Sz5eJRufVdc6Q8sZ26TJD0Yf2SSHbDB7Wdfnk X-Received: by 2002:a17:906:6a09:: with SMTP id o9mr1800853ejr.289.1570614308884; Wed, 09 Oct 2019 02:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570614308; cv=none; d=google.com; s=arc-20160816; b=APX6HpytGlxin0dhKFkpAZ/jShrFUJSBwZGIRNpPnNYm09lnSjEO1yPzo/OZ/GgBZU qmy8OHixRqJ/6PGR29j5LSF1H8ZdBfLC/Fz0Se0mONZs2X31n/KaZoD7Vi+7iM4xFt6X ACngfg3/U8xm28AJG7B08GRrEDHK4eXHKDloULXB1GJnvEcVF7ul9HaHI7z8UH9dE87C uU+G//VaIHNzRZ+Tlev5cKGg4mXdXMaSEOMtRvxbsmc6Uk3mcI3clxWQDhr22Xgo0NfG D59hn3+fXtN4n91iYJGciUPRCRaG66pmYc+2+noBoLakmFiyGn1Mb67vRpNK2RAfD4Ki RUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IgLlslTtHyY/DsCT/GempjMqnPIRbjKjjsT71GS80BU=; b=jICS3R2f8UyKppfNFViJSBEi1yw5mySasf6/44C0IRsyyasRMzSTsss7KFoJdF5pBL BgNdOsYRQ7A1oDt4EB3JSYo9+8qqHyjmDXiRKWKLO1aXlzt97/pSwesz7le4idpL5Lor /khWhtdfGfPt+w8H5hJE//vyPX1Nuj55CUu5oXOaGvks0Aarbf1flcBDV2QbRKE4dFiB tVXiDLHFfVwMeRfSjWwFpvilUm5Kp8AnhKmJzkGEcQN4BJ/W6C3LsYz08Rh288/ekd+B RlS0epR2ROagtvMdRfNbupX7wCsPjWkRg59sB3TJuNhWrbbsBHmlyIMHnk809X/3jn+1 uYzA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 c8si1106743edb.82.2019.10.09.02.44.45; Wed, 09 Oct 2019 02:45:08 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728200AbfJIJoi (ORCPT + 99 others); Wed, 9 Oct 2019 05:44:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728054AbfJIJoi (ORCPT ); Wed, 9 Oct 2019 05:44:38 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D3D551F0B for ; Wed, 9 Oct 2019 09:44:37 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id o128so1969189wmo.1 for ; Wed, 09 Oct 2019 02:44:37 -0700 (PDT) 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:user-agent; bh=IgLlslTtHyY/DsCT/GempjMqnPIRbjKjjsT71GS80BU=; b=r4BZM8vnmGbxL3rF09AbWD/i6ZGf4JuJtkOpwbyodnMMCqhwJiVwm3QxjMLQpcFcWQ Ntg0nXhJIr+7qRoHYHH/97hOQ7WF/PynVZu4PU5WHjzkx4q2nWTKshj6iAks+uxV4Qbp 2e1LQGtbQCElSJ5KvN5wfc2UCMi287bK/HqduJLMCERWcPHF8iL4bfN1hdyW2s5JUuPf 8gzVrfNt9vqPcGABSgqMGu0WYQcJCHP97B4sbunfSDYYkNccsmiNQPtIQoq/V7v8PKu8 tu3hvZLhevHbWymjY8hJIrTw1uRxkvDHVOBzPDkJQ0+SDl7Ln6YEjYS919aJbUyum9yI wFKg== X-Gm-Message-State: APjAAAXLEO8kVFiLveK8lZ4igF1Q6QMx9jjxzQjQPLGlZvNUwK8grdku b7/TP2QvQjtO1J867sZG8sT2Un4K17OD2U1MTcT9mF8xVcLrbmbOQuMByTjffVhGj0QpuGSb7K5 wTtEobh6eOFaK+e9HWOHdlCb/ X-Received: by 2002:a1c:7311:: with SMTP id d17mr1768163wmb.49.1570614275927; Wed, 09 Oct 2019 02:44:35 -0700 (PDT) X-Received: by 2002:a1c:7311:: with SMTP id d17mr1768146wmb.49.1570614275686; Wed, 09 Oct 2019 02:44:35 -0700 (PDT) Received: from steredhat (host174-200-dynamic.52-79-r.retail.telecomitalia.it. [79.52.200.174]) by smtp.gmail.com with ESMTPSA id a3sm1320859wmj.35.2019.10.09.02.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 02:44:35 -0700 (PDT) Date: Wed, 9 Oct 2019 11:44:32 +0200 From: Stefano Garzarella To: netdev@vger.kernel.org, Stefan Hajnoczi Cc: linux-hyperv@vger.kernel.org, "K. Y. Srinivasan" , Sasha Levin , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "David S. Miller" , virtualization@lists.linux-foundation.org, Stephen Hemminger , Jason Wang , "Michael S. Tsirkin" , Haiyang Zhang , Dexuan Cui , Jorgen Hansen Subject: Re: [RFC PATCH 11/13] vsock: add 'transport_hg' to handle g2h\h2g transports Message-ID: <20191009094432.by5zs4c3binrznpp@steredhat> References: <20190927112703.17745-1-sgarzare@redhat.com> <20190927112703.17745-12-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190927112703.17745-12-sgarzare@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 27, 2019 at 01:27:01PM +0200, Stefano Garzarella wrote: > VMCI transport provides both g2h and h2g behaviors in a single > transport. > We are able to set (or not) the g2h behavior, detecting if we > are in a VMware guest (or not), but the h2g feature is always set. > This prevents to load other h2g transports while we are in a > VMware guest. > > This patch adds a new 'transport_hg' to handle this case, reducing > the priority of transports that provide both g2h and h2g > behaviors. A transport that has g2h and h2g features, can be > bypassed by a transport that has only the h2g feature. > Since I'm enabling the VSOCK_TRANSPORT_F_G2H in the vmci_transport only when we run in a VMware guest, this patch doesn't work well if a KVM (or HyperV) guest application create an AF_VSOCK socket and no transports are loaded, because in this case the vmci_transport is loaded (MODULE_ALIAS_NETPROTO(PF_VSOCK)) and it is registered as transport_h2g. At this point, if we want to run a nested VM using vhost_transport, we can't load it. So, I can leave VSOCK_TRANSPORT_F_G2H always set in the vmci_transport and this should fix this issue. Or maybe I need to change how the registering works, e.g. handling a list of transport registered, setting priority or using the last registered transport. Any suggestion? Thanks, Stefano