Received: by 10.213.65.68 with SMTP id h4csp3785496imn; Tue, 3 Apr 2018 10:34:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/dbUnvMRe5tlhoN7BwcCUNbzeD65iYIraY0cxUMiHF2/gtIIbJgng0GNVCMBhJqUwqiwyS X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr15356454plg.23.1522776886398; Tue, 03 Apr 2018 10:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522776886; cv=none; d=google.com; s=arc-20160816; b=zT4q21REhL2mZQQHva3L25MV7osFV6CrBGrRV7jnL/WOdhGF8gMDcFYy84ABX9kxDc MBr4aD+9/PE9Q7uR/VcGwUbgcaoNGDu8zAprGa950tZgpcdJn93PM30MRZDDqbtY5Lzt zvF03BLL8/dPxeq46e3HO3X8N3f/36Yq243Fn8K1HW8iV6/IPpU6LFM27y+krBT2mCgh 0Njp60gypPdTjHN9vyjRoWjYIUOnmCQpruCgB5x6Zwd5RDnPhZNMEwvCQ5DLCvqmGhtN FbKVgb1wLiU6ksuLvcBaU0hPmBUJsOm/D9N8yvJ2YXALxQpg9ByC89wfpurgaD2PoVM1 VKRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ytvQFtvnxmjpOOkyRBhxElTIdSJ83d0wQogt90kdDlg=; b=JikTW0XMQVfj1GTbBA0SF1bvoYmwelKEQd5JxApPSE+M9lN7CyoQ0iMB3EKtjO1VTT JTTQ2C7dmDc6yPH/O1gHw/c2z7wuKeMjEFQUVO7O1GY4ZbB3mfVP3ID7PxBxkqBLlQY1 l8JOD3sM7D42il5j+2chl435pmELwUrg8PPjdmm1aThiil4Ne73If77/ysB1AHm8R1He G46AKPLJ3P/GihkJ1rZgbPAj19Z3TWD7RQLiA02vtrkcxW5J/3wqJFDl5LRWieDbEHih nrpkjyiFHtov+0dql9AFkFkr5wNhNmhTKPxkhP1HUW2l2HD8HWZPRHh5b6f7odvRRdFd DqxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TOBwCs/g; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3-v6si917282pli.274.2018.04.03.10.34.31; Tue, 03 Apr 2018 10:34:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TOBwCs/g; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752886AbeDCRcH (ORCPT + 99 others); Tue, 3 Apr 2018 13:32:07 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50425 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbeDCRcD (ORCPT ); Tue, 3 Apr 2018 13:32:03 -0400 Received: by mail-wm0-f66.google.com with SMTP id t67so15461793wmt.0; Tue, 03 Apr 2018 10:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ytvQFtvnxmjpOOkyRBhxElTIdSJ83d0wQogt90kdDlg=; b=TOBwCs/g/XHRr5wp4daG3Pk+D4FZ4rJeVkwIdG6UQafk47+6C31rNgOlT9rHY78weg 6A8uF+jD4BrKUk+Fdu1YjkVJkcyJXP5/AkObT64bi9EIejRWgvbA/gZ8vJYSQDZWXxrm NM+dXDhp2Qoz46HRM7AVep27gVjcB045hzizItsmJnI2Y7Mwt9WQu9ST8N8gB5tk9k5P LIJ2PPW0qAMgKYupPBfXd4XrMq1UzXZe66cugshAYDCID+BeBYsQCnU5+y9R64dzOWv/ 4zn8ErtfCsqt1Yce410pOqTUmkeen/STcIOQ+Pj852qFN1LUptWWkKBUGx9HvmVMJgDk eawg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ytvQFtvnxmjpOOkyRBhxElTIdSJ83d0wQogt90kdDlg=; b=M3aCfvFaM3ZXouZKhh/sUSADONfEyVBGV00vUqba4lIqRkaKBPhVz+IdRhkCdRU4gv GFlptH64EAI0pR0GublV30lBTHn36FwHQaVVf+2gt/EdQ528g7Gqr2I+zVe4TCh0+QBy zHPhuIhwh4blN62ne8ahLtXYOBaCmIt9Dwp9V2lOM93C3O4NP9QR0/F89kWIU+6g2koa HZp5s7RH7gNeCE7iGIYgAGi3KVBxrL7pB+m+uNyZKlX8dmVTz1o2O+rgBwAkxtM9WP60 Bq0OavcJbs1SKxDz4svienVDY9JNAsCYtULOoQeml2nin0YfrNX9lYUQQVTNi4JLVt5f qJkA== X-Gm-Message-State: AElRT7Gjp+SgHlNCwM8VxVQ9YfMqIi+LJbv02g0VOkAU6wCwSQdtkpU0 Wd/cHJFEkPCCxwCtE3DSNR/kUjOWGFADVmXbMiM= X-Received: by 10.28.230.148 with SMTP id e20mr4533145wmi.89.1522776721744; Tue, 03 Apr 2018 10:32:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.184.189 with HTTP; Tue, 3 Apr 2018 10:32:00 -0700 (PDT) In-Reply-To: <20180403161151-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> From: Alexander Duyck Date: Tue, 3 Apr 2018 10:32:00 -0700 Message-ID: Subject: Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices To: "Michael S. Tsirkin" 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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