Received: by 10.223.185.116 with SMTP id b49csp4279783wrg; Mon, 26 Feb 2018 14:39:50 -0800 (PST) X-Google-Smtp-Source: AH8x224ukc7XpU9FHxFYCHeHOmGK9GulYIbgvl10pyTK7eB8OIPxV0PKQZKn6PCvHxAvillrO/sM X-Received: by 10.99.116.22 with SMTP id p22mr9788922pgc.132.1519684790191; Mon, 26 Feb 2018 14:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519684790; cv=none; d=google.com; s=arc-20160816; b=rVEEGuwBcOj75y4cTJSdx9kfcRS6Cayjs3oEDZb+BplZW9dhJWAFpv3zps2mVGi8sK XTK42vJQ+ZI7axtHDOZVNXOLrU+tGK83pZdiqLv/7or5+DgTqLnwP2T9dH7fByTZdBQj JGiGXfw0NZW7tfMA7c2EJTfEaY6QziA1vCpTipxY5GhFToeCU93tuFkhdRynpNbxGn7X 1fN9ZJR/h37lFUQYiiuuIfZAf355HQFthciKvXCAu4wKv9LOiIuotuovl2MIa2xL+oC6 nwSksPZAIHEacqxl2Gqj6R0gYcUaimeOCj/cHR9sfn331UtjWtnnOrR/I3siwQCp6k4k pZ8Q== 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 :arc-authentication-results; bh=Nk+7m2qOw75I4SgWPh3uLqoRdMI/roDrTg/8GVYCtWY=; b=IXt6aGP8E1nK/jR/jUE9rR7rY4JoFNiNsILkgfp4xPlz3kQqbYx+7yk64Dnvh2MDDn ww44EHeuBuraR9aDs4cNHAz4HaeywN4ZCuQn2h2HT2Tax4jb0U33cA7H3rx9IqgBf+TJ tsy/yxuQ49g8fVWJkb7P8jmF2vITuOrAYvE5WjWWSLqcHfpPsp04HvdVuV5UD/lij2oS b/sReHdg7aYZmIEye88TloNf1W/7ZPzBtxo0A9F0DNgY7WVtJyqLcW/pYZm+Ngt47oUc JRip/dk5EyStWk+d/F7ex0Z9XrqgkO3BpximOTe4elO0onNfirBaXtSxCu7SYj9QNfTw yB4Q== 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 w5si6026771pgv.514.2018.02.26.14.39.34; Mon, 26 Feb 2018 14:39:50 -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; 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 S1751713AbeBZWiU (ORCPT + 99 others); Mon, 26 Feb 2018 17:38:20 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43664 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751661AbeBZWiS (ORCPT ); Mon, 26 Feb 2018 17:38:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 078D1400187D; Mon, 26 Feb 2018 22:38:18 +0000 (UTC) Received: from redhat.com (ovpn-125-210.rdu2.redhat.com [10.10.125.210]) by smtp.corp.redhat.com (Postfix) with SMTP id 8ADBA1C715; Mon, 26 Feb 2018 22:38:15 +0000 (UTC) Date: Tue, 27 Feb 2018 00:38:15 +0200 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: "Rustad, Mark D" , "virtio-dev@lists.oasis-open.org" , Netdev , LKML , "linux-pci@vger.kernel.org" , "Daly, Dan" , Alex Williamson , "MRustad@gmail.com" Subject: Re: [RFC PATCH V4] pci: virtio_pci: Add SR-IOV support for virtio_pci devices Message-ID: <20180227003257-mutt-send-email-mst@kernel.org> References: <20180226044837.19543.12267.stgit@mdrustad-mac04.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Feb 2018 22:38:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Feb 2018 22:38:18 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 26, 2018 at 10:05:31AM -0800, Alexander Duyck wrote: > On Mon, Feb 26, 2018 at 9:48 AM, Rustad, Mark D wrote: > > Alex, > > > >> On Feb 26, 2018, at 7:26 AM, Alexander Duyck wrote: > >> > >> Mark, > >> > >> In the future please don't put my "Reviewed-by" on a patch that I > >> haven't reviewed. I believe I reviewed one of the earlier patches, but > >> I hadn't reviewed this version. > > > > I'm very sorry. I completely spaced doing something about that. I think yours was the first Reviewed-by I ever had in this way. In the future I will remove such things from my changelog right after sending. Thanks for alerting me to what I had failed to do. > > > >> Also, after thinking about it over the weekend we may want to look at > >> just coming up with a truly "generic" solution that is applied to > >> SR-IOV capable devices that don't have a SR-IOV capable driver loaded > >> on them. That would allow us to handle the uio, vfio, pci-stub, and > >> virtio cases all in one fell swoop. I think us going though and > >> modifying one patch at a time to do this kind of thing isn't going to > >> scale. > > > > The notion of that kind of troubles me - at least pci-stub does. Having worked on ixgbe a bit, I have to wonder what kind of havoc would ensue if an ixgbe device were assigned to a guest, and an attempt was made to allocate VFs by the pci-stub. The guest could be running any version of the ixgbe driver, possibly even an old one that didn't support SR-IOV. Even if it did support SR-IOV, I don't know how it would respond to mailbox messages when it doesn't think it has VFs. > > The assumption here is that the root user knows what they are doing. There are tools that let non-root users load the stub. People use that to e.g. prevent a native driver from loading while also assuming it won't break the kernel. > We have already had some discussion on this in regards to VFIO. My > thought is we look at adding a new PCI sysfs option called > "sriov_unmanaged_autoprobe" that would be similar to > "sriov_drivers_autoprobe" and is used to determine if we allow for > auto probing of the VFs into the host kernel when SR-IOV is enabled. I'm not sure how a global option can work for use-cases such as containers though. > I > would want to default the value to false so that by default an > unmanaged PF wouldn't have its VFs assigned to the host unless we > specifically enable it by updating the sysfs value. > > >> I'll try to do some digging and find the VFIO approach we had been > >> working on. I think with a couple tweaks we can probably make that > >> truly generic and ready for submission. > > > > I'd like to know more about you are thinking about. > > Basic idea is to take your generic SR-IOV enable/disable bits from > (http://patchwork.ozlabs.org/patch/877674/) and combine it with the > some of the autoprobe bits and feedback comments from > (http://patchwork.ozlabs.org/patch/846454/). The idea would be when > either no driver is loaded, or a driver without the sriov_configure > method we update the iov auto probe setting based on the value we set > via sriov_unamanaged_autoprobe, and then call your generic > configuration method to enable SR-IOV.