Received: by 10.213.65.68 with SMTP id h4csp178348imn; Mon, 12 Mar 2018 10:21:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELsJ2jFID95t8PdB0k27ox6cGpT483/vpUoPh6tSvmjTStQNiAwHoud1fqoig/qteZD5zQwi X-Received: by 10.101.97.72 with SMTP id o8mr7354397pgv.119.1520875300316; Mon, 12 Mar 2018 10:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520875300; cv=none; d=google.com; s=arc-20160816; b=y3qI1HPPYHiY5Zc/wCw3h9W6cy7zCVgr/b1T3+Snc6rjdjP1mYVHhWmdoOUMrxHtgb nDRlaOTM/AWwNXlSRbGN81Lpa9u0LXe5UEOjawCQwO7WVOezRDQkRMODGxLdeLCqEgPE J0CoFZk/5cvKbXGvJUkzAPdcI87FVYv95FYgxcFea8znOJOLg1Opk9i9HTomuRScU4Z3 oU7tduGXIkdogWP2x+vVMwIuCJQa22v8XjfkZbk8uWt8CeyyoFnVKGq0rMsHN43+oSOP jqshOo54wxKUtDT+lDz5CcEl0AZQQeXXeH8zhPOra4DELFRoPW4+Y/nHla3Yr0hGDGoc jEWw== 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:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=ncRoahw1EAlotXwDcNRe6tEBc0/ZU1EW/7KBEUO0rMc=; b=scYKOFAdIPJhrObNRHLXllclePOSWJbtw7pNmR7lQ2NLTT7IpH2+jX+ZJfJoDabFOE 1xph+x+zq2Z3G8HZD2RVQy1NQ8DLVvUHC/y/1jPwEH5MiEnYBmnFdt7obLJheBOXbtEF Ay6gbyPNA3a7ZdgDInnE020hyPHF8oifx0AESKL74TXqGrTyILUxVqkTfqy8KSXm4A5k TFkC1FSf27JSoMqZsXAXn807hljMvT/be7X4keQQo+qV74tfxR6S6T4J5yv1Ply/UIaz lNI6/CUIzT/LEoOLSvxqxRoxFqxHg7qsupH9zmz/TgDznXFj4HzC4xhMx+US1qroSuAQ mSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EJwSroQZ; 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 c2si5221370pgp.611.2018.03.12.10.21.25; Mon, 12 Mar 2018 10:21:40 -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=EJwSroQZ; 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 S932651AbeCLRU3 (ORCPT + 99 others); Mon, 12 Mar 2018 13:20:29 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:36926 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbeCLRU1 (ORCPT ); Mon, 12 Mar 2018 13:20:27 -0400 Received: by mail-io0-f195.google.com with SMTP id d71so12358845iog.4; Mon, 12 Mar 2018 10:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=ncRoahw1EAlotXwDcNRe6tEBc0/ZU1EW/7KBEUO0rMc=; b=EJwSroQZAr9iCbeIm4TP8encTsnIztyvHjTyQk5OAShsADzj66oX1b6CztNyzdwddT whpGbysaAxSLJ0QkWHJDI27dWbHe4C26Z5Rd5mcxxd4+hdoApvA+yDdKvPemIn8XgNqC 3Q18VN2WgdRFw58x9EFDG1RRX1Errffl1SflGScDbeoKU2E9Q1ohOBrlEaPvGNvIMcXD StO2J1XW6vBMTQbuRYSBG2eik0AAyFGPwEs+ZTxkbhOkk4V3rsd4gVPaRDXvEIsYRCGi d9aNo4Q3RnI5XlnOTmZ2XPGIaVxqcI/pJiMPDQ/EKPoPwmr6mii/aT1Ko9VSzMSNP/vb RBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=ncRoahw1EAlotXwDcNRe6tEBc0/ZU1EW/7KBEUO0rMc=; b=LfUT8uFJCDt3UOVXgUhyJyTiC50j6i7QVmu9VTCLVqOpK7f0dVFEagvJTxN9a0q4AG 4bOCr4ozOLwkXijtWcCy0XhVMO04a5/+L2U0caK6pM4FisgtoNpThC6OoQjqqfz4BxMT zSbvlQfAPhyCqLrt0n66hrZsJXpxtjPgsbF5KYitAAdCnvyYR3CPI9a8tW5F6H/2Vcxe wIimTXB7+KaSYL3pwXzwauv71j2z0Gp3gp91S6sl+qF0nEhRz69P+TuVggwpkGlrmxYh qQcWK/IbKf5N1qYJTO/RFR5SGNnzQ14sntYjQtVnv0E2MnElhtQKtJGiwiRKV1INfQQp kkgg== X-Gm-Message-State: AElRT7Fc9OAEnRy4c/WJ5qPyBhUJ36T5H0g1t8tPhRbUHHbVcKdCrsIU 4rQ6xZjZh/wyEPWl92mga/E= X-Received: by 10.107.204.1 with SMTP id c1mr10089843iog.59.1520875226559; Mon, 12 Mar 2018 10:20:26 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id a128sm1438448ioe.2.2018.03.12.10.20.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 10:20:26 -0700 (PDT) Subject: [pci PATCH v5 0/4] Series short description From: Alexander Duyck To: 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 Date: Mon, 12 Mar 2018 10:20:23 -0700 Message-ID: <20180312171813.3487.94803.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Mark Rustad Cc: Maximilian Heyne Cc: Liang-Min Wang Cc: David Woodhouse --- Alexander Duyck (4): 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 drivers/net/ethernet/amazon/ena/ena_netdev.c | 30 ++---------------------- drivers/nvme/host/pci.c | 22 ++---------------- drivers/pci/iov.c | 32 ++++++++++++++++++++++++++ drivers/virtio/virtio_pci_common.c | 3 ++ include/linux/pci.h | 1 + 5 files changed, 42 insertions(+), 46 deletions(-) --