Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3007390ybz; Mon, 27 Apr 2020 08:23:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJ1SlxhbYwketiqV69RQXtY46tgws9+eUyje+FHq+xqajV5/AIXEktnXg4LH1gHZ3bDDLjW X-Received: by 2002:a50:d981:: with SMTP id w1mr18557579edj.275.1588000996960; Mon, 27 Apr 2020 08:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588000996; cv=none; d=google.com; s=arc-20160816; b=I1C+Qf1TRmEQl2EIqbjTs/5TwJ5T8LnWHwloBs6H8GU7R8qD1G839KZunB72vWc1PJ M+67ECk+jH6mT4VZWgaRBrTFKhudtdO88VY1+vCluq0GWtzNOnmMDE4lnbtb3NTdYH7L n8G/JHTY8h//xQKv4KAJZjDzIMJz+P3flvw8gGLwtGwIPs9OhFaTyKiiOYv7zK3F/vwv 7+Qvp4EHx1PC5eU96P4E7YRm0Wzy40D7+YvssJkXDXKHQaIbIsPDL0k3kFUQerMLJxsp 5K3Ox2wZ1JlLUhW+jNUcs5R2TI6TBpCfSP1e/eVFyXDcvtu+96ugL8sMoPL/NlY7wwOs am1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=t0zUuDSHC2LYYJLNAsloYEAAqSEOkEn10YRd/wXdi+k=; b=sRHXBHXCp/7QKwDvIkX51Tr0nze8npDwYWwoAr4wGT6OuzYK5OePq1cCOws3AEY/5M LTO4llBAloBXeFJqUc9WByAdiSxOqLt3LSC3Aj7fw0UMvjOmHr37GdIT14yo95W1rqa1 PVYrTneaYc5cZyghfWyay7Ow8qXJ19Xr6IsPykR/jgTeM+dUma3J6LLBD5iqLAOsguzP MVQR5ulPgAzR4o72FkDFWSP7N5+AXz6l2p5XUwHIpTqbszQDD4jmUoRKYjgnw5CNesb3 LyPza9XxhvQeV8byvE6JbIk2VrR+RuruDTAHyq4G4a3PWlSBp/gcQGQwuFOTDtl3C75h vwag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SfZ0IZhe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id y10si8614224edt.393.2020.04.27.08.22.53; Mon, 27 Apr 2020 08:23:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SfZ0IZhe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728084AbgD0PVN (ORCPT + 99 others); Mon, 27 Apr 2020 11:21:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20595 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727768AbgD0PVM (ORCPT ); Mon, 27 Apr 2020 11:21:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588000870; 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: in-reply-to:in-reply-to:references:references; bh=t0zUuDSHC2LYYJLNAsloYEAAqSEOkEn10YRd/wXdi+k=; b=SfZ0IZheyMg6ghHTswOQGdrY+Rpys1Mi/KkEVLlbxCDRtBaItNqwp/1tLm81F1R0dUNVwE vZ7R8h9VNwMlVmM/DrOIszdygHdadb3hcjGsOpvO71bnsyupfDTxgC8IYYkElvOa5CiaO/ +RFALVW2+XmKzEB6dGNJY7orxCdqWy4= 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-2-J_d3VEOKM5ir-kRT5Ibnew-1; Mon, 27 Apr 2020 11:21:08 -0400 X-MC-Unique: J_d3VEOKM5ir-kRT5Ibnew-1 Received: by mail-wr1-f69.google.com with SMTP id m5so10645633wru.15 for ; Mon, 27 Apr 2020 08:21:08 -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; bh=t0zUuDSHC2LYYJLNAsloYEAAqSEOkEn10YRd/wXdi+k=; b=O+uVF3WJVPac43qIH+46tddB+QMFcD3WgKL3YYeZwmPM4y5aGCc41rPBCxo6OqCv5p cTeZPCAbu0/lDA1Y38679vjuKZ7DqnBHo1Np25lJxn/VIlAuSmAx6chuoi0uGe0gBXOd hsoUZEIOWgJd9vIXDeuNU9wH+DhF1ckXEPlgaaJRkBAWdnLhEhjdcgyGQL1bdSthWOqK m8YBWF0qa7zuCunCl3G9hWHvUtzrStcmk4xaW5OEyTV28sSiL2Slk8GUb37gvWqJOTdH CBzZFIZDHpsHST6vlmD2NJU9bIwaCqWhiBBhumxRPQwMPKr/k5lB80T6SBAxuyYPsdrV 2ezA== X-Gm-Message-State: AGi0PuaJ2bTEQvbEIkilsj0mzj3wtMcQYevfAfgvCrbRU5fvyob1tFV1 MU0mx0FlNI+uUalzGyZX5lROorCQ0LKczghmr/Ktxl5HElPLVV1YQgCEQpXY6RdA1Thgf9YThpr zF4DhdyzsniB9fmZZMj0Epjf7 X-Received: by 2002:a1c:b445:: with SMTP id d66mr38649wmf.187.1588000867454; Mon, 27 Apr 2020 08:21:07 -0700 (PDT) X-Received: by 2002:a1c:b445:: with SMTP id d66mr38611wmf.187.1588000867197; Mon, 27 Apr 2020 08:21:07 -0700 (PDT) Received: from steredhat (host108-207-dynamic.49-79-r.retail.telecomitalia.it. [79.49.207.108]) by smtp.gmail.com with ESMTPSA id r3sm22637536wrx.72.2020.04.27.08.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 08:21:06 -0700 (PDT) Date: Mon, 27 Apr 2020 17:21:03 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: davem@davemloft.net, Stefan Hajnoczi , linux-kernel@vger.kernel.org, Jorgen Hansen , Jason Wang , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-hyperv@vger.kernel.org, Dexuan Cui , netdev@vger.kernel.org Subject: Re: [PATCH net-next 0/3] vsock: support network namespace Message-ID: <20200427152103.r65new4r342crfs6@steredhat> References: <20200116172428.311437-1-sgarzare@redhat.com> <20200427142518.uwssa6dtasrp3bfc@steredhat> <20200427102828-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200427102828-mutt-send-email-mst@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 10:31:57AM -0400, Michael S. Tsirkin wrote: > On Mon, Apr 27, 2020 at 04:25:18PM +0200, Stefano Garzarella wrote: > > Hi David, Michael, Stefan, > > I'm restarting to work on this topic since Kata guys are interested to > > have that, especially on the guest side. > > > > While working on the v2 I had few doubts, and I'd like to have your > > suggestions: > > > > 1. netns assigned to the device inside the guest > > > > Currently I assigned this device to 'init_net'. Maybe it is better > > if we allow the user to decide which netns assign to the device > > or to disable this new feature to have the same behavior as before > > (host reachable from any netns). > > I think we can handle this in the vsock core and not in the single > > transports. > > > > The simplest way that I found, is to add a new > > IOCTL_VM_SOCKETS_ASSIGN_G2H_NETNS to /dev/vsock to enable the feature > > and assign the device to the same netns of the process that do the > > ioctl(), but I'm not sure it is clean enough. > > > > Maybe it is better to add new rtnetlink messages, but I'm not sure if > > it is feasible since we don't have a netdev device. > > > > What do you suggest? > > Maybe /dev/vsock-netns here too, like in the host? > I'm not sure I get it. In the guest, /dev/vsock is only used to get the CID assigned to the guest through an ioctl(). In the virtio-vsock case, the guest transport is loaded when it is discovered on the PCI bus, so we need a way to "move" it to a netns or to specify which netns should be used when it is probed. > > > > > 2. netns assigned in the host > > > > As Michael suggested, I added a new /dev/vhost-vsock-netns to allow > > userspace application to use this new feature, leaving to > > /dev/vhost-vsock the previous behavior (guest reachable from any > > netns). > > > > I like this approach, but I had these doubts: > > > > - I need to allocate a new minor for that device (e.g. > > VHOST_VSOCK_NETNS_MINOR) or is there an alternative way that I can > > use? > > Not that I see. I agree it's a bit annoying. I'll think about it a bit. > Thanks for that! An idea that I had, was to add a new ioctl to /dev/vhost-vsock to enable the netns support, but I'm not sure it is a clean approach. > > - It is vhost-vsock specific, should we provide something handled in > > the vsock core, maybe centralizing the CID allocation and adding a > > new IOCTL or rtnetlink message like for the guest side? > > (maybe it could be a second step, and for now we can continue with > > the new device) > > Thanks, Stefano