Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752341AbdI0XHC (ORCPT ); Wed, 27 Sep 2017 19:07:02 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35016 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbdI0XHA (ORCPT ); Wed, 27 Sep 2017 19:07:00 -0400 X-Google-Smtp-Source: AOwi7QD3/y8k8habCpyQihDW8Nl13ZMYBSogvd5ZAvgHoId8xMSmIkwrDtotVXeuf3HDo0TR9cPInIx310b22VV3nW4= MIME-Version: 1.0 In-Reply-To: <1506550852.7476.33.camel@infradead.org> References: <1506517162.30379.2.camel@infradead.org> <20170927220005.GB23674@bhelgaas-glaptop.roam.corp.google.com> <1506550852.7476.33.camel@infradead.org> From: Alexander Duyck Date: Wed, 27 Sep 2017 16:06:59 -0700 Message-ID: Subject: Re: [PATCH] uio/uio_pci_generic: Add SR-IOV support To: David Woodhouse Cc: Bjorn Helgaas , Greg Kroah-Hartman , linux-pci , linux-kernel , Donald Dutile , Alexander Duyck , "Bryant G. Ly" , Bodong Wang , Alex Williamson , "Michael S. Tsirkin" , kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 26 On Wed, Sep 27, 2017 at 3:20 PM, David Woodhouse wrote: > On Wed, 2017-09-27 at 17:00 -0500, Bjorn Helgaas wrote: >> >> >> IIUC, this question is basically "why doesn't the PCI core enable IOV >> automatically when it sees an IOV-capable device?" >> >> I think one reason is that an admin might want to control the number >> of VFs we enable (e.g., via 1789382a72a5 ("PCI: SRIOV control and >> status via sysfs" [1]). But I guess you already know about that, >> since this patch uses that sysfs path, so maybe I don't understand >> your question. > > > I mean, why doesn't the PCI core *allow* SR-IOV to be enabled via > sysfs, unless the driver does this? The general idea is that the driver usually has to free up resources so they can be reassigned to the VF devices. For example in the case of the Intel NICs enabling SR-IOV reassigns the queues to the VFs, and the PF has to be aware that this change is happening so that it doesn't try to make use of queues that then belong to the VFs. - Alex