Received: by 10.213.65.68 with SMTP id h4csp3838219imn; Tue, 3 Apr 2018 11:29:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx497UnZ26xLXwWJMMH2Yh/3ZsAS0ImbAw/U2zJmuUOBkk5ag4SYDHMr3bmdNNOwOGH0IRADM X-Received: by 2002:a17:902:6bc3:: with SMTP id m3-v6mr15092106plt.363.1522780160134; Tue, 03 Apr 2018 11:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522780160; cv=none; d=google.com; s=arc-20160816; b=OGptgAeXRA3XAKOH6NRxXIVnA+SoSbnG7dLbthA0CyRBVkYFNXfRedvmYhoMxyQwTQ klvqMZCT5rLuPLRotAfN7tqpbzF6xQRkBVUTeTysNoH6S4/XEw2EC0TRb/6HVSXR01u3 pO5j7Vc4uw8tfCC406qHYkvnFJMeYYPzG8+tbmdz6xrjssN/RM30847HFw5VDhYm1anL Y2M2N+GwHMtpa1xl0b3WW8Ed3hNGFhAdvDvPn4+7R4mTsSElkvP0nLJTqkhxUTzinoau 4r6k57mR6xDT7L0y8TH2w6NjpV7tV5ZpLI2O3qjIcYG5tuRpRVolQ5QIo58WXxUL5Aha 0Gsw== 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=uocYfoL/ZYkje3RhicSzzFSyiwp2wpVy23HMzPboCGk=; b=tdgaWAxoG2c1X3Rhp38eS241SW2lPWJzjizvh69yJ/z9WP3AaMgXXSbwZ85fTqMYzo jFalhRsV6UHL9gChJTNjkxayqneqxWKA3F/I9263Xrr8SFgA8gbCghH1nNXZ8tGdEl6A i4Y8ywZDGPg3Ib7S9X8zEyO7kuIFsjXgFS5Zx4iCRd1Bbmu3ia23oo/A2w1O+xHvu3At HCUOx/Zwp7dDoxPqjZ7Eqm3c7b0Uhs/qsOkWcce/DPLxPP+b11Ss4CSL+ArGWCoRZI/l hIvHmHIpgmjjCXOihFXUbfY24u98LU8jCbcFLbKmpJyxagPqx1+st6/PlSLkw9o/ql7X q2Xw== 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 w2si2274327pgm.336.2018.04.03.11.29.06; Tue, 03 Apr 2018 11:29:20 -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 S1752946AbeDCS1s (ORCPT + 99 others); Tue, 3 Apr 2018 14:27:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752785AbeDCS1p (ORCPT ); Tue, 3 Apr 2018 14:27:45 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D619F4067EF0; Tue, 3 Apr 2018 18:27:44 +0000 (UTC) Received: from redhat.com (ovpn-126-67.rdu2.redhat.com [10.10.126.67]) by smtp.corp.redhat.com (Postfix) with SMTP id D1333215CDAF; Tue, 3 Apr 2018 18:27:43 +0000 (UTC) Date: Tue, 3 Apr 2018 21:27:43 +0300 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: "Daly, Dan" , Bjorn Helgaas , "Duyck, Alexander H" , linux-pci@vger.kernel.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, Netdev , LKML , linux-nvme@lists.infradead.org, Keith Busch , netanel@amazon.com, Don Dutile , Maximilian Heyne , "Wang, Liang-min" , "Rustad, Mark D" , David Woodhouse , Christoph Hellwig , dwmw@amazon.co.uk Subject: Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices Message-ID: <20180403212503-mutt-send-email-mst@kernel.org> References: <20180315183449.3102.64791.stgit@localhost.localdomain> <20180315184132.3102.90947.stgit@localhost.localdomain> <20180316183042-mutt-send-email-mst@kernel.org> <20180403161151-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 18:27:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 18:27:45 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 Tue, Apr 03, 2018 at 10:32:00AM -0700, Alexander Duyck wrote: > On Tue, Apr 3, 2018 at 6:12 AM, Michael S. Tsirkin wrote: > > On Fri, Mar 16, 2018 at 09:40:34AM -0700, Alexander Duyck wrote: > >> On Fri, Mar 16, 2018 at 9:34 AM, Michael S. Tsirkin wrote: > >> > On Thu, Mar 15, 2018 at 11:42:41AM -0700, Alexander Duyck wrote: > >> >> From: Alexander Duyck > >> >> > >> >> Hardware-realized virtio_pci devices can implement SR-IOV, so this > >> >> patch enables its use. The device in question is an upcoming Intel > >> >> NIC that implements both a virtio_net PF and virtio_net VFs. These > >> >> are hardware realizations of what has been up to now been a software > >> >> interface. > >> >> > >> >> The device in question has the following 4-part PCI IDs: > >> >> > >> >> PF: vendor: 1af4 device: 1041 subvendor: 8086 subdevice: 15fe > >> >> VF: vendor: 1af4 device: 1041 subvendor: 8086 subdevice: 05fe > >> >> > >> >> The patch currently needs no check for device ID, because the callback > >> >> will never be made for devices that do not assert the capability or > >> >> when run on a platform incapable of SR-IOV. > >> >> > >> >> One reason for this patch is because the hardware requires the > >> >> vendor ID of a VF to be the same as the vendor ID of the PF that > >> >> created it. So it seemed logical to simply have a fully-functioning > >> >> virtio_net PF create the VFs. This patch makes that possible. > >> >> > >> >> Reviewed-by: Christoph Hellwig > >> >> Signed-off-by: Mark Rustad > >> >> Signed-off-by: Alexander Duyck > >> > > >> > So if and when virtio PFs can manage the VFs, then we can > >> > add a feature bit for that? > >> > Seems reasonable. > >> > >> Yes. If nothing else you may not even need a feature bit depending on > >> how things go. > > > > OTOH if the interface is changed in an incompatible way, > > and old Linux will attempt to drive the new device > > since there is no check. > > > > I think we should add a feature bit right away. > > I'm not sure why you would need a feature bit. The capability is > controlled via PCI configuration space. If it is present the device > has the capability. If it is not then it does not. > > Basically if the PCI configuration space is not present then the sysfs > entries will not be spawned and nothing will attempt to use this > function. > > - ALex It's about compability with older guests which ignore the capability. The feature is thus helpful so host knows whether guest supports VFs. -- MSR