Received: by 10.192.165.148 with SMTP id m20csp5181826imm; Tue, 24 Apr 2018 15:24:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx49qra9Xzf2N91+/ZEQdmR5VBqU13deaO0R8U2jMEef09+7Ounp0Za22oRPy4E4GdB/PswVk X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr26583999plb.155.1524608660553; Tue, 24 Apr 2018 15:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524608660; cv=none; d=google.com; s=arc-20160816; b=QLa4RD7dk+/0looT0Zq722PpIt5z7mradPmsN5AmxzvRo3NIcTLgtdj6uABeHHWJ9N o+fOY6zAK92ixFhnHQpoLx2rYiekCodhfuewmpjG4DxWdjcOUpmrF+Xu+OuQlBi8CISX qdCBj3AZ1/XnyeMj6K+CYVlurnP759dac5DwPuqpGi+Cup7JWDyaTp15A1PjDzXp/6Lr Byz05kl8b1zaseJJbHBy5yqQvLeybfty4eTrPIImnT4KKDL/5xr1/sjnU6/Chn/nxDQY rq5WTmuYHGv/z1On10YaJ/3c4yUPy0MF9b2RYbroZjSwVexmNfitfkn5PNRmko4h164O 6hGg== 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=w5NXN9Qpq2qHKT+DI86f1Q8274MvjOhKDrbKGHrkHAg=; b=pvzXzh2Onm1eBk04vEs6X5CSNL7M4nkZeKAe5NMh7XweadIIeXwIa1EMucoEJuA8uu PBH31rj/qiOc8R4hoWaA6R4v4y2jfWmzCIx1aF99VJDA9B11KCseUtmvV1trnxgbwATa 224al6fjGUm9k567fjKLoKVATqpg2OxyXN/7828+2ksn5lQ69Ee7cn9m3V8UKO5w+n2J BvqGBbZxqtarffQm5dGpoZ39cpy/DEda2BvN7bt0KHoH3CT4w9VMqD2QvokFo57RZhrm PVU/iSatTjWsRn9hzAspJSSUyGoTzoOlsNuGxvyQBTR5ZRGFsEZcClfkEEi6jiXgTNTT pX8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lEtsWvt7; 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 q7si12818326pgs.193.2018.04.24.15.24.06; Tue, 24 Apr 2018 15:24: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lEtsWvt7; 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 S1751231AbeDXWXA (ORCPT + 99 others); Tue, 24 Apr 2018 18:23:00 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:34198 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbeDXWWz (ORCPT ); Tue, 24 Apr 2018 18:22:55 -0400 Received: by mail-ot0-f195.google.com with SMTP id i5-v6so23172697oth.1; Tue, 24 Apr 2018 15:22:55 -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=w5NXN9Qpq2qHKT+DI86f1Q8274MvjOhKDrbKGHrkHAg=; b=lEtsWvt75Xo+4AWWlCkObkyVQzduaC8gOllGZO1IgT5mGChIUTYCzDAWMgsWxmpCsJ lmPxoY4S1JNQgieilLHtUPsCSlwF4DS6b0aNdOBYGfjtPShfIILhy/lwMFvcAws4KC5M M5p4WuMvyWVP0+MRVqwY8SBG6HvHAAAhI4K8cz39crOht5B9qVWCfXUgwcdOUoqJLhqg 5k57ly3ySWNlDcSwwremUhHZFFbK4Jj/3tJ8j2CBxa5nzv8azWTdPn9MRFU9Qq6Z1yGw LDfd/THw8S3DwP3z26oVOkoDwfQyQzMwDEHkCEOX+gTa2GVj9mN1LEPUYP+bAxhwAhjg o73Q== 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=w5NXN9Qpq2qHKT+DI86f1Q8274MvjOhKDrbKGHrkHAg=; b=dxnnKdWgujzeIgtHYFEkjX2e1djXU4BVN1gkZ4jLsJHMoiHjgoW22sMqWfBNJgu9ax 6Osr+3wk+bXRSK4tubjgLXlfWRLK1GWbPfWzwOgo/V6voj9tpgwOP92ITyZc7vTFuU1z Zql4+OCBSs6I/7XbFiso0LklI1GxifkIXZ/vhtkWQiEsL8zLbVzn2mR9XeP2QoZHQYS4 QOu0lJD62SxLdy7SSPJjP0V8lpumdafkFXJwZ/CSzpkQ/DebTyaE2lW8eWxdCQoLzYMQ 60tlhoeJE4luULOzYUltpiu6N8vu7U67AqdhKkbYua029iswpMLCwJSHpCfMLEbxG5hz F9cA== X-Gm-Message-State: ALQs6tBDmRehP84RThUryEn5A2iSMLIOkESyXxSAiToLw7cdRtJURYY2 3xO7LW9VfjsVzSrwf5QQI0F7+Ex2yBP1GbbPRwhzhg== X-Received: by 2002:a9d:21f4:: with SMTP id s107-v6mr16936314otb.237.1524608574751; Tue, 24 Apr 2018 15:22:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.201.10.209 with HTTP; Tue, 24 Apr 2018 15:22:54 -0700 (PDT) In-Reply-To: <20180424215150.GB72698@bhelgaas-glaptop.roam.corp.google.com> References: <20180420162633.46077.49012.stgit@ahduyck-green-test.jf.intel.com> <20180421203437.GW28657@bhelgaas-glaptop.roam.corp.google.com> <20180424215150.GB72698@bhelgaas-glaptop.roam.corp.google.com> From: Alexander Duyck Date: Tue, 24 Apr 2018 15:22:54 -0700 Message-ID: Subject: Re: [pci PATCH v8 0/4] Add support for unmanaged SR-IOV To: Bjorn Helgaas Cc: Alexander Duyck , Bjorn Helgaas , linux-pci@vger.kernel.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, Netdev , "Daly, Dan" , 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 24, 2018 at 2:51 PM, Bjorn Helgaas wrote: > On Sat, Apr 21, 2018 at 05:22:27PM -0700, Alexander Duyck wrote: >> On Sat, Apr 21, 2018 at 1:34 PM, Bjorn Helgaas wrote: > >> > For example, I'm not sure what you mean by "devices where the PF is >> > not capable of managing VF resources." >> > >> > It *sounds* like you're saying the hardware works differently on some >> > devices, but I don't think that's what you mean. I think you're >> > saying something about which drivers are used for the PF and the VF. >> >> That is sort of what I am saying. >> >> So for example with ixgbe there is functionality which is controlled >> in the MMIO space of the PF that affects the functionality of the VFs >> that are generated on the device. The PF has to rearrange the >> resources such as queues and interrupts on the device before it can >> enable SR-IOV, and it could alter those later to limit what the VF is >> capable of doing. >> >> The model I am dealing with via this patch set has a PF that is not >> much different than the VFs other than the fact that it has some >> extended configuration space bits in place for SR-IOV, ARI, ACS, and >> whatever other bits are needed in order to support spawning isolated >> VFs. > > OK, thanks for the explanation, I think I understand what's going on > now, correct me if I'm mistaken. I added a hint about "PF" for Randy, > too. > > These are on pci/virtualization for v4.18. I reviewed them and all of the changes to patches 1 & 2 both below, and in the tree look good to me. Thanks for taking care of all this. - Alex > commit 8effc395c209 > Author: Alexander Duyck > Date: Sat Apr 21 15:23:09 2018 -0500 > > PCI/IOV: Add pci_sriov_configure_simple() > > SR-IOV (Single Root I/O Virtualization) is an optional PCIe capability (see > PCIe r4.0, sec 9). A PCIe Function with the SR-IOV capability is referred > to as a PF (Physical Function). If SR-IOV is enabled on the PF, several > VFs (Virtual Functions) may be created. The VFs can be individually > assigned to virtual machines, which allows them to share a single hardware > device while being isolated from each other. > > Some SR-IOV devices have resources such as queues and interrupts that must > be set up in the PF before enabling the VFs, so they require a PF driver to > do that. > > Other SR-IOV devices don't require any PF setup before enabling VFs. Add a > pci_sriov_configure_simple() interface so PF drivers for such devices can > use it without repeating the VF-enabling code. > > Tested-by: Mark Rustad > Signed-off-by: Alexander Duyck > [bhelgaas: changelog, comment] > Signed-off-by: Bjorn Helgaas > Reviewed-by: Greg Rose > Reviewed-by: Christoph Hellwig :wq > > commit a8ccf8a66663 > Author: Alexander Duyck > Date: Tue Apr 24 16:47:16 2018 -0500 > > PCI/IOV: Add pci-pf-stub driver for PFs that only enable VFs > > Some SR-IOV PF devices provide no functionality other than acting as a > means of enabling VFs. For these devices, we want to enable the VFs and > assign them to guest virtual machines, but there's no need to have a driver > for the PF itself. > > Add a new pci-pf-stub driver to claim those PF devices and provide the > generic VF enable functionality. An administrator can use the sysfs > "sriov_numvfs" file to enable VFs, then assign them to guests. > > For now I only have one example ID provided by Amazon in terms of devices > that require this functionality. The general idea is that in the future we > will see other devices added as vendors come up with devices where the PF > is more or less just a lightweight shim used to allocate VFs. > > Signed-off-by: Alexander Duyck > [bhelgaas: changelog] > Signed-off-by: Bjorn Helgaas > Reviewed-by: Greg Rose > Reviewed-by: Christoph Hellwig > > commit 115ddc491922 > Author: Alexander Duyck > Date: Tue Apr 24 16:47:22 2018 -0500 > > net: ena: Use pci_sriov_configure_simple() to enable VFs > > Instead of implementing our own version of a SR-IOV configuration stub in > the ena driver, use the existing pci_sriov_configure_simple() function. > > Signed-off-by: Alexander Duyck > Signed-off-by: Bjorn Helgaas > Reviewed-by: Greg Rose > Reviewed-by: Christoph Hellwig > > commit 74d986abc20b > Author: Alexander Duyck > Date: Tue Apr 24 16:47:27 2018 -0500 > > nvme-pci: Use pci_sriov_configure_simple() to enable VFs > > Instead of implementing our own version of a SR-IOV configuration stub in > the nvme driver, use the existing pci_sriov_configure_simple() function. > > Signed-off-by: Alexander Duyck > Signed-off-by: Bjorn Helgaas > Reviewed-by: Christoph Hellwig