Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799AbdDKVvt (ORCPT ); Tue, 11 Apr 2017 17:51:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbdDKVvh (ORCPT ); Tue, 11 Apr 2017 17:51:37 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4E75BC05973C Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=alex.williamson@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4E75BC05973C Date: Tue, 11 Apr 2017 15:51:33 -0600 From: Alex Williamson To: Bjorn Helgaas Cc: bodong@mellanox.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, saeedm@mellanox.com, Eli Cohen Subject: Re: [v2] PCI: Add an option to control probing of VFs before enabling SR-IOV Message-ID: <20170411155133.64a330ac@t450s.home> In-Reply-To: <20170411211211.GB14778@bhelgaas-glaptop.roam.corp.google.com> References: <1490198038-20465-1-git-send-email-bodong@mellanox.com> <20170411211211.GB14778@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 11 Apr 2017 21:51:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1891 Lines: 45 On Tue, 11 Apr 2017 16:12:11 -0500 Bjorn Helgaas wrote: > Hi Bodong, > > On Wed, Mar 22, 2017 at 05:53:58PM +0200, bodong@mellanox.com wrote: > > From: Bodong Wang > > > > Sometimes it is not desirable to probe the virtual functions after > > SRIOV is enabled. This can save host side resource usage by VF > > instances which would be eventually probed to VMs. > > > > Add a new PCI sysfs interface "sriov_probe_vfs" to control that > > from the PF, all current callers still retain the same functionality. > > To modify it, echo 0/n/N (disable probe) or 1/y/Y (enable probe) to > > > > /sys/bus/pci/devices//sriov_probe_vfs > > Is this basically the same functionality as /sys/bus/pci/drivers_autoprobe, > but limited to a specific PF? I.e., could we accomplish the same thing > with the following? > > # echo 0 > /sys/bus/pci/devices/DDDD:BB:dd.f/sriov_numvfs > # echo 0 > /sys/bus/pci/drivers_autoprobe > # echo 2 > /sys/bus/pci/devices/DDDD:BB:dd.f/sriov_numvfs > # echo 1 > /sys/bus/pci/drivers_autoprobe > > If not, can you contrast the above with drivers_autoprobe? If we need > both, should they be named more similarly? Logically it's similar, but the above is racy, not only would userspace need to serialize such operations but a device hot added during that blackout period wouldn't be probed. So this is like a per PF drivers_autoprobe for the VFs hosted by that device. Thanks, Alex > > Note that, the choice must be made before enabling VFs. The change > > will not take effect if VFs are already enabled. Simply, one can set > > sriov_numvfs to 0, choose whether to probe or not, and then resume > > sriov_numvfs. > > > > Signed-off-by: Bodong Wang > > Signed-off-by: Eli Cohen > > Reviewed-by: Gavin Shan