Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3469768ybl; Tue, 21 Jan 2020 01:08:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyLsv0JiqCexzf/82dyXctqAiID3EVQHMNQA1soWJQ/gjJsjwOSm9uQiY1/r/W6wOmH3TSZ X-Received: by 2002:aca:52cd:: with SMTP id g196mr2283931oib.18.1579597704143; Tue, 21 Jan 2020 01:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579597704; cv=none; d=google.com; s=arc-20160816; b=X+FsXj668U47GAfpupVNCpjpKqX+XjRWli5XNv6EkgAm+rVw+C2DXtXfVRbHjdyq4M BF9R2ISZR5ApeEia9DuLVvjKCTBtCd8jY2NWiyuljNNSgber5rEKXJpAYx5w5ZJfUQSO 62nVqftm0OAKgZXfY+dp4QhjOX88dzDMFY2stm3+yimj1JbFRsa3zQw7hklKb634KxuY KJFGyyTbmUbACRCepLWMGwb6lwQ58Px3+IKz9+A0FFJ8PpM+ZPxTFF/juunsMHCVOEd+ v5encfHFmVbhY4CKnZ/B2piQ9sCT6MMUOx3EHUFJVpKeMqbWWEgKKL876W1CUbZIPc/a bgNQ== 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=aBt9kA8Q3sfLDPWSB6WPSmED3batQYaL6AuEX7S5BEo=; b=Vm1p8moe0n9bYvlYJoLucip062Pt0MdILFecaNARtHxb5UUepLSto339aXKsGAQ6fE jYBDZqTqoDVXF1lB0W9mCVO5uSCZT3cfQMdblz+ptcs/ZmlEMFkL9XOCb6NojxBJcUZY eVvAtC4IzSAKfmmbJssbMrc8vUNdR01Th/tjuKZWpN+s0tXVsmYyuXR9xfqi9r1nLFbj T6CqVLjmsvXKHSqR4nHQPsdwrcHFqiXl3FPVJjubhmTKzD1D8dufbXZnSBorfbNZkeql aKe7GsoWG717JVTE70d91YZNV6AraWgWDbslHH3m9LGRyv2/N+yQMdMHO+yadzNuoFKq Rp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gjmhZB8V; 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 t82si19802060oif.45.2020.01.21.01.08.12; Tue, 21 Jan 2020 01:08:24 -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=gjmhZB8V; 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 S1729149AbgAUJHR (ORCPT + 99 others); Tue, 21 Jan 2020 04:07:17 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:44599 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728816AbgAUJHR (ORCPT ); Tue, 21 Jan 2020 04:07:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579597636; 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=aBt9kA8Q3sfLDPWSB6WPSmED3batQYaL6AuEX7S5BEo=; b=gjmhZB8VfzkQCPcB6tXhmtc0C3ToCJfn0qP/12MYn+L+sf360/xHslzZ3HmK8M6zqVUDcY AeMghAzd9q9gynjiLyIeXEyvNJ2E6XQJGuscM+jgi9MqeaaGTQQ1YPSUEbKkotLxKFP8Z6 Nj995UiXUQ2C2CBsL7BGdBDBg1Rvc2Y= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-7Uhwf49HOVycELEcAWsyNw-1; Tue, 21 Jan 2020 04:07:11 -0500 X-MC-Unique: 7Uhwf49HOVycELEcAWsyNw-1 Received: by mail-wr1-f70.google.com with SMTP id y7so1032618wrm.3 for ; Tue, 21 Jan 2020 01:07:11 -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=aBt9kA8Q3sfLDPWSB6WPSmED3batQYaL6AuEX7S5BEo=; b=XdCIu/3tUuuOe0L1vchKzpSV2wuc9tmHl9JQVfgPEdy6xyyWBxwl6p6oVQ0MBbhnsd avoFZE3CjXF0tFdtgyzt9/cp8tcNN1lnOEi87K2JmMWEc0uPdw3zotMEXP3axHmaDxDf ogilFbARyu4H2XBElKvJi5kjOMwYKyyPgl+17WkwNyoUmqnSSl7AdeIkw2EfhzKc+N3G vRCkjF4mCp/0yleeWLppTALP4qUVpek1rVYmiA1IoKEoofZj+X1+Wpjqr0rVQNpeKVKU lPmo9ShQwOmq9iavn6aRnvopXT8TwdGH9DauvOfZD6oT9rq+E41F18abFmgDeyEIUMW5 PSRw== X-Gm-Message-State: APjAAAVBycqGYzhWhf3d+JuNWiNn9iyDshivSAxD72nVMtbo5G3JW+Mr KF1A1uIfW1s9k+DwAfRCr1INhnMTXDHCyzZOh8m8G9lycW+GJJUEtvcsOGmeeA3bz614F3RNs47 Hon2bNKvC+bXD6MxXY6GgJG3w X-Received: by 2002:adf:ebc3:: with SMTP id v3mr4130258wrn.280.1579597630114; Tue, 21 Jan 2020 01:07:10 -0800 (PST) X-Received: by 2002:adf:ebc3:: with SMTP id v3mr4130222wrn.280.1579597629862; Tue, 21 Jan 2020 01:07:09 -0800 (PST) Received: from steredhat (host84-49-dynamic.31-79-r.retail.telecomitalia.it. [79.31.49.84]) by smtp.gmail.com with ESMTPSA id r68sm2990217wmr.43.2020.01.21.01.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 01:07:09 -0800 (PST) Date: Tue, 21 Jan 2020 10:07:06 +0100 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jorgen Hansen , Jason Wang , kvm , Stefan Hajnoczi , virtualization@lists.linux-foundation.org, linux-hyperv@vger.kernel.org, Dexuan Cui Subject: Re: [PATCH net-next 1/3] vsock: add network namespace support Message-ID: References: <20200116172428.311437-1-sgarzare@redhat.com> <20200116172428.311437-2-sgarzare@redhat.com> <20200120.100610.546818167633238909.davem@davemloft.net> <20200120101735.uyh4o64gb4njakw5@steredhat> <20200120060601-mutt-send-email-mst@kernel.org> <20200120110319-mutt-send-email-mst@kernel.org> <20200120170120-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200120170120-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, Jan 20, 2020 at 11:02 PM Michael S. Tsirkin wrote: > On Mon, Jan 20, 2020 at 05:53:39PM +0100, Stefano Garzarella wrote: > > On Mon, Jan 20, 2020 at 5:04 PM Michael S. Tsirkin wrote: > > > On Mon, Jan 20, 2020 at 02:58:01PM +0100, Stefano Garzarella wrote: > > > > On Mon, Jan 20, 2020 at 1:03 PM Michael S. Tsirkin wrote: > > > > > On Mon, Jan 20, 2020 at 11:17:35AM +0100, Stefano Garzarella wrote: > > > > > > On Mon, Jan 20, 2020 at 10:06:10AM +0100, David Miller wrote: > > > > > > > From: Stefano Garzarella > > > > > > > Date: Thu, 16 Jan 2020 18:24:26 +0100 > > > > > > > > > > > > > > > This patch adds 'netns' module param to enable this new feature > > > > > > > > (disabled by default), because it changes vsock's behavior with > > > > > > > > network namespaces and could break existing applications. > > > > > > > > > > > > > > Sorry, no. > > > > > > > > > > > > > > I wonder if you can even design a legitimate, reasonable, use case > > > > > > > where these netns changes could break things. > > > > > > > > > > > > I forgot to mention the use case. > > > > > > I tried the RFC with Kata containers and we found that Kata shim-v1 > > > > > > doesn't work (Kata shim-v2 works as is) because there are the following > > > > > > processes involved: > > > > > > - kata-runtime (runs in the init_netns) opens /dev/vhost-vsock and > > > > > > passes it to qemu > > > > > > - kata-shim (runs in a container) wants to talk with the guest but the > > > > > > vsock device is assigned to the init_netns and kata-shim runs in a > > > > > > different netns, so the communication is not allowed > > > > > > But, as you said, this could be a wrong design, indeed they already > > > > > > found a fix, but I was not sure if others could have the same issue. > > > > > > > > > > > > In this case, do you think it is acceptable to make this change in > > > > > > the vsock's behavior with netns and ask the user to change the design? > > > > > > > > > > David's question is what would be a usecase that's broken > > > > > (as opposed to fixed) by enabling this by default. > > > > > > > > Yes, I got that. Thanks for clarifying. > > > > I just reported a broken example that can be fixed with a different > > > > design (due to the fact that before this series, vsock devices were > > > > accessible to all netns). > > > > > > > > > > > > > > If it does exist, you need a way for userspace to opt-in, > > > > > module parameter isn't that. > > > > > > > > Okay, but I honestly can't find a case that can't be solved. > > > > So I don't know whether to add an option (ioctl, sysfs ?) or wait for > > > > a real case to come up. > > > > > > > > I'll try to see better if there's any particular case where we need > > > > to disable netns in vsock. > > > > > > > > Thanks, > > > > Stefano > > > > > > Me neither. so what did you have in mind when you wrote: > > > "could break existing applications"? > > > > I had in mind: > > 1. the Kata case. It is fixable (the fix is not merged on kata), but > > older versions will not work with newer Linux. > > meaning they will keep not working, right? Right, I mean without this series they work, with this series they work only if the netns support is disabled or with a patch proposed but not merged in kata. > > > 2. a single process running on init_netns that wants to communicate with > > VMs handled by VMMs running in different netns, but this case can be > > solved opening the /dev/vhost-vsock in the same netns of the process > > that wants to communicate with the VMs (init_netns in this case), and > > passig it to the VMM. > > again right now they just don't work, right? Right, as above. What do you recommend I do? Thanks, Stefano