Received: by 10.213.65.68 with SMTP id h4csp1776880imn; Mon, 19 Mar 2018 13:00:08 -0700 (PDT) X-Google-Smtp-Source: AG47ELum3GttOtKYC32FqkipvvEuvA9RsU0FkcKeW2DGUqk/xNqV1lYiSJ1Zg5FrhhmeY1Nyqxec X-Received: by 2002:a17:902:8545:: with SMTP id d5-v6mr13642806plo.20.1521489608018; Mon, 19 Mar 2018 13:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489607; cv=none; d=google.com; s=arc-20160816; b=0lnnlGnu2sfnzII87W6EomC0nxZ1m4sbQHHB64scT/laNmpOU1h6CdFWBBCtkG4LC8 VX/l3sRt4arSNlg2UiNNMHZSAaCq+MJnAYYv2pFg6r6ioZVnohBwhFe5XmgccwseYglr EvPfE1t0Pmewqe1O9hRapTPtDp6teyT2Z14Cuk3S4UETeAu+/xB/tJ3hymMLKR90t0PU p2RvbtOd0bWLNKyqNBGpN6pFtiovbiJoNPMAiDZ2M+mRjDixTXuqN70xR58CDKCu+kDe bubj51b9nURUx2+C4yw8DmThFDpvJXTi+oYY+52bA6uIRsD2cLZvtJcr29/dJCSrmfKl VyTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=uWvev91F8xXqi4TC0vXu+Zb5W0/ZvFc+Wv8lxtCuhYs=; b=Famu71eigKXNLMwEqItrb8UOdupbdgN48z8DxYYCq05S+ZCt7J68IGQNKvKRv/DTxI LlOboJSqYkh+WMeC6qOG2s644x61HMg6wmkS/k7uwTJTnQPek1h/fGNCxWKYC/gHm8ih 6UihCKjvLWOrEvWYY4FfB1B8+pZCsrtqXNh69mCo+Nhof1YtHNKdM6fxjYvELGO3UGZq do6xXKfmUuZlFOWZrL+FzqgWyP+JsW7KvFTCbEA5a2r7Gvo3K0bCIlp8PHJGnnE0lcyZ Az6clEOYjHEXVaP1Rbf6l+WPET1pOsNjsxwhWyxEIze6oG1xaegLlAm8SEqc0dyzo+R/ zbLg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc5-v6si564573plb.506.2018.03.19.12.59.53; Mon, 19 Mar 2018 13:00:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030943AbeCST6G (ORCPT + 99 others); Mon, 19 Mar 2018 15:58:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969447AbeCST6B (ORCPT ); Mon, 19 Mar 2018 15:58:01 -0400 Received: from localhost (231.sub-174-234-133.myvzw.com [174.234.133.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7BE9C2178C; Mon, 19 Mar 2018 19:58:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BE9C2178C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Mon, 19 Mar 2018 14:57:58 -0500 From: Bjorn Helgaas To: KarimAllah Ahmed Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH] PCI/IOV: Skip initializing the base addresses from the VF config space Message-ID: <20180319195758.GK77194@bhelgaas-glaptop.roam.corp.google.com> References: <1520051590-11750-1-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520051590-11750-1-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 03, 2018 at 05:33:10AM +0100, KarimAllah Ahmed wrote: > Per PCIe r4.0, sec 9.3.4.1.11, the BARs registers from the VF config space > are all RO Zero for PCI VFs. So just skip reading them for VFs. > > This is an optimization when enabling SR-IOV on a device with many VFs. > > Cc: Bjorn Helgaas > Cc: linux-pci@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Suggested-by: Bjorn Helgaas > Signed-off-by: KarimAllah Ahmed Applied to pci/virtualization for v4.17, thanks! > --- > drivers/pci/probe.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index a96837e..7204d46 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -329,6 +329,10 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) > if (dev->non_compliant_bars) > return; > > + /* Per PCIe r4.0, sec 9.3.4.1.11, the VF BARs are all RO Zero */ > + if (dev->is_virtfn) > + return; > + > for (pos = 0; pos < howmany; pos++) { > struct resource *res = &dev->resource[pos]; > reg = PCI_BASE_ADDRESS_0 + (pos << 2); > -- > 2.7.4 >