Received: by 10.213.65.68 with SMTP id h4csp43710imn; Tue, 27 Mar 2018 16:02:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+hRT3cGEudfpj/U8qMKrmt5f5tb2B58+36joNElr4OoR9bi6Q6q8LyYnZ0xBm0WL5eKGj X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr1189324pll.319.1522191733011; Tue, 27 Mar 2018 16:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522191732; cv=none; d=google.com; s=arc-20160816; b=MsYuWjmH3TEwukG+wzw7iZWQCf96yVzEkqw1bUIKi/3ci/bkaH8g1kI+uv+lL7uqxt hKLqCB99Cgd2BF7FAtcpggflO7Qw/wZ+WTMsAv7eIE8LzgU4sFAH3sKqt/gv945Vtc09 Sik3ENo3WDO4Xo7hVF0lEN8MCWSpphQoQQGXBCSXGaqgmM7+59MNYv8/8F2Cf1rS5LzD Qw0r68PUc4Xu+9FpskVNKg24Y+YKPoBv6La+zh/X4TDEIyP92+QFu0ZF/+UFeEonPzIZ 6dEE8g3y4LsYYSxa65mWepm7AIGL5IYbpDgy0qMUXBaJtEijv+s/QuJjPAdNU5oEHfgu 6Vvw== 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 :mime-version:dkim-signature:arc-authentication-results; bh=CF0tdpIKN5iK0GFPIhYkPBi5g1ChMo4BWbqcICq8EKY=; b=KgonI9m8GXVOHK0RVgFEcjcb1A+ftibzz32Jx7D62R2xpr7kxDe8E7Gh/o8OuvEub9 qs9535UQ5VmJu9QZcT6sZDBOLPQdqi+fFyXqtHzKRZuu4A8LsM03r3QX6vGq/HLxbttQ 2I5ZWiGYfTC0elGpOdhe+okGjs3ZtoYJTA3DCKggKNVCdUoHPPSr9Ys5ttlAQHLd69Gs Y7EAushFMXAc7EDTGNtHK4EdWOb3mXytBonnUJb5ALB0ZNKYvuNMQ3umrdDifGfprwnm hQh/IDaUSN5FpdIOaAQOUeVwNvKgtHy8sNVEO/+o/M/lb5G/Pk/cHgtVtjUIWA5SXJxd jSMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=huXC/bC8; 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 a5si1706979pfl.165.2018.03.27.16.01.58; Tue, 27 Mar 2018 16:02:12 -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=huXC/bC8; 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 S1752397AbeC0XAz (ORCPT + 99 others); Tue, 27 Mar 2018 19:00:55 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53873 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbeC0XAx (ORCPT ); Tue, 27 Mar 2018 19:00:53 -0400 Received: by mail-wm0-f68.google.com with SMTP id p9so1557825wmc.3; Tue, 27 Mar 2018 16:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=CF0tdpIKN5iK0GFPIhYkPBi5g1ChMo4BWbqcICq8EKY=; b=huXC/bC8PY+dcX3MVaRv4+PyUGoUFdHCxgR004PVcO6I0rsKT2OURCxgdSoVDO2HnO jVBNu9AZD1JloVEWP7iceVLabKXh2W6hWRtR6xl12HP8C2trjgOFfuEBvgIg9J+e7c/X NpWJFgcD6ZKyfZyltJQs7xyjqc2gQPEyaUTgsHsS60dzk0hyv01s2kEvHGqF0dtn4Cdc 2hxetHEtmc4pFtso/CKWpASj+8QoeB/IUANS/sTBYFTyZyPLrr1dvdNx7qGgFNZRBokm PTZXr07I1fAuMgKlyDRKf/ftU7XuW2WFlWqCRaCRzD+hK6hvg0hMpBlyrowCIrH9+US+ iFTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=CF0tdpIKN5iK0GFPIhYkPBi5g1ChMo4BWbqcICq8EKY=; b=VdQhk1ZPDTHfuX1i/6/AVdh2cqJaZz+VtWB2CHtstq5Anc7PY29WabISF3aihlbgFx gr1sBgShsqW1RrXE+JpUWE2l/KKsUxwY2aTEnUBu4RG0l2x8FhKL1ZuWzFcrEhQRWM33 CVgH6RPWpl0Ob6JWSPRn4G5z7Xx8GZE3U5qFOFrkgcOM5t04ZBzrBfKo6PssOnz0YyKZ 1muCGM+FL2QONqqLOrL4l+8wvgjubVzSnPF1tv/Jq2wlDfYd0gqkuNtiDqJ0Smy3jfak +0bB8kq2nawRgxDLg0Visvem/Q+lWimdLkUf3lCy06pETJQF9V2G8tATfyArYTV0Pq61 KALQ== X-Gm-Message-State: AElRT7FZcEdXWHjsZinoqZHTEi+QQrWeWks2uD7zaSvbY1C49KTDAubd ocBWKPf3zAQHdOAyjpxRifbXFt7b0CNKmMik0Ag= X-Received: by 10.28.43.66 with SMTP id r63mr822293wmr.93.1522191651619; Tue, 27 Mar 2018 16:00:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.184.189 with HTTP; Tue, 27 Mar 2018 16:00:51 -0700 (PDT) From: Alexander Duyck Date: Tue, 27 Mar 2018 16:00:51 -0700 Message-ID: Subject: Re: [pci PATCH v7 0/5] Add support for unmanaged SR-IOV To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: "Duyck, Alexander H" , virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, Netdev , "Daly, Dan" , LKML , linux-nvme@lists.infradead.org, Keith Busch , netanel@amazon.com, Maximilian Heyne , "Wang, Liang-min" , "Rustad, Mark D" , David Woodhouse , Christoph Hellwig , dwmw@amazon.co.uk, Don Dutile 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 Fri, Mar 16, 2018 at 2:42 PM, Don Dutile wrote: > 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 Any issues with getting this pulled into the linux-pci tree? When I submitted these that was the original target for this set, or do I need to look at breaking them up and/or submitting them submitted somewhere else? Thanks. - Alex