Received: by 10.213.65.68 with SMTP id h4csp654473imn; Fri, 16 Mar 2018 14:44:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELtUrWAmICfNcHvtDgtTpuzli5z2rHHlmwMMs8d5/rLDpPS9NExdm6gF0PRgFNZGDgg3fZ8c X-Received: by 10.99.124.79 with SMTP id l15mr2647593pgn.19.1521236651575; Fri, 16 Mar 2018 14:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521236651; cv=none; d=google.com; s=arc-20160816; b=FavIpeqGEDEcltyiOy/eme8eYspj+N+RxtzUfkjPGDHvUXtG1l+iGVfbl778utPinE kk9puFH7GlKC9rx+NxCwmDYbr2wCddnxVXmjxH2qO5R+GZvQpisIHpT3cNdTfrvW8Ejm k28NvqQEEmYiPni4Jp2ZlMN5uChAWTYOLIxutto3792AGjF386soDbVsR+LCKCZAWuGX nGaEldXZendYfv51nubnm3/kBONRsFvY5N64UIPSNmuvH5S0rg53iUf1NJYpkfqLKVsc TCXtqeDaKKDHaTd1jsYj8b0y701Iw4uL3G+E14vOwi/Bn6M5U+qhyAuEF252ywId6/G3 Harg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=il2me2LECgWnRSUvYhuESHKCgJp2boxXTKvg0SmA7Bw=; b=Bv2gWglbW/rWQXLO0WifKHd/X+rCDfGfbpCQN/RkG8/pDGs6NW91qyWdDoQOAZDLOE NJCYqYbBPfpPupFjYLjpBWQS84kzHWRSuKxyFz0jDV2q4RU77y6EwVycTyZzCfaCFAhj 4gUYpYzvM7wxYhbLxE8HQG3fBjT2fcfGWwA0TSQtrlhlAtRi9J3ofixHKnT1Cjx++kOZ 4hNIlKEuzBnQY2dJnNzB8Yxmiaw24LVZt/hOPHwR6OaV6emXok7+pGeW/uuCEmtBtRHv rR+5BbXFuMRWdyoSY0VWpRY3IuKyRMejfiNVw549SBWqexSgb0wjY4r4pIdsYqfoGmQC PWsA== 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 q6-v6si3410676plk.234.2018.03.16.14.43.54; Fri, 16 Mar 2018 14:44:11 -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 S1751902AbeCPVmt (ORCPT + 99 others); Fri, 16 Mar 2018 17:42:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbeCPVms (ORCPT ); Fri, 16 Mar 2018 17:42:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98D9D1B282B; Fri, 16 Mar 2018 21:42:47 +0000 (UTC) Received: from [10.3.116.196] (ovpn-116-196.phx2.redhat.com [10.3.116.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44286600C8; Fri, 16 Mar 2018 21:42:45 +0000 (UTC) Subject: Re: [pci PATCH v7 0/5] Add support for unmanaged SR-IOV To: Alexander Duyck , bhelgaas@google.com, alexander.h.duyck@intel.com, linux-pci@vger.kernel.org Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, netdev@vger.kernel.org, dan.daly@intel.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, keith.busch@intel.com, netanel@amazon.com, mheyne@amazon.de, liang-min.wang@intel.com, mark.d.rustad@intel.com, dwmw2@infradead.org, hch@lst.de, dwmw@amazon.co.uk References: <20180315183449.3102.64791.stgit@localhost.localdomain> From: Don Dutile Message-ID: Date: Fri, 16 Mar 2018 17:42:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180315183449.3102.64791.stgit@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 16 Mar 2018 21:42:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 02:40 PM, Alexander Duyck wrote: > This series is meant to add support for SR-IOV on devices when the VFs are > not managed by the kernel. Examples of recent patches attempting to do this > include: > virto - https://patchwork.kernel.org/patch/10241225/ > pci-stub - https://patchwork.kernel.org/patch/10109935/ > vfio - https://patchwork.kernel.org/patch/10103353/ > uio - https://patchwork.kernel.org/patch/9974031/ > > Since this is quickly blowing up into a multi-driver problem it is probably > best to implement this solution as generically as possible. > > This series is an attempt to do that. What we do with this patch set is > provide a generic framework to enable SR-IOV in the case that the PF driver > doesn't support managing the VFs itself. > > I based my patch set originally on the patch by Mark Rustad but there isn't > much left after going through and cleaning out the bits that were no longer > needed, and after incorporating the feedback from David Miller. At this point > the only items to be fully reused was his patch description which is now > present in patch 3 of the set. > > This solution is limited in scope to just adding support for devices that > provide no functionality for SR-IOV other than allocating the VFs by > calling pci_enable_sriov. Previous sets had included patches for VFIO, but > for now I am dropping that as the scope of that work is larger then I > think I can take on at this time. > > v2: Reduced scope back to just virtio_pci and vfio-pci > Broke into 3 patch set from single patch > Changed autoprobe behavior to always set when num_vfs is set non-zero > v3: Updated Documentation to clarify when sriov_unmanaged_autoprobe is used > Wrapped vfio_pci_sriov_configure to fix build errors w/o SR-IOV in kernel > v4: Dropped vfio-pci patch > Added ena and nvme to drivers now using pci_sriov_configure_unmanaged > Dropped pci_disable_sriov call in virtio_pci to be consistent with ena > v5: Dropped sriov_unmanaged_autoprobe and pci_sriov_conifgure_unmanaged > Added new patch that enables pci_sriov_configure_simple > Updated drivers to use pci_sriov_configure_simple > v6: Defined pci_sriov_configure_simple as NULL when SR-IOV is not enabled > Updated drivers to drop "#ifdef" checks for IOV > Added pci-pf-stub as place for PF-only drivers to add support > v7: Dropped pci_id table explanation from pci-pf-stub driver > Updated pci_sriov_configure_simple to drop need for err value > Fixed comment explaining why pci_sriov_configure_simple is NULL > > Cc: Mark Rustad > Cc: Maximilian Heyne > Cc: Liang-Min Wang > Cc: David Woodhouse > > --- > > Alexander Duyck (5): > pci: Add pci_sriov_configure_simple for PFs that don't manage VF resources > virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices > ena: Migrate over to unmanaged SR-IOV support > nvme: Migrate over to unmanaged SR-IOV support > pci-pf-stub: Add PF driver stub for PFs that function only to enable VFs > > > drivers/net/ethernet/amazon/ena/ena_netdev.c | 28 ------------- > drivers/nvme/host/pci.c | 20 ---------- > drivers/pci/Kconfig | 12 ++++++ > drivers/pci/Makefile | 2 + > drivers/pci/iov.c | 31 +++++++++++++++ > drivers/pci/pci-pf-stub.c | 54 ++++++++++++++++++++++++++ > drivers/virtio/virtio_pci_common.c | 1 > include/linux/pci.h | 3 + > include/linux/pci_ids.h | 2 + > 9 files changed, 107 insertions(+), 46 deletions(-) > create mode 100644 drivers/pci/pci-pf-stub.c > > -- > For what it's worth. Good, simpler start for this type of support/effort. Thanks for the multiple versions to get to this point. Reviewed-by: Donald Dutile