Received: by 10.192.165.148 with SMTP id m20csp4867325imm; Tue, 8 May 2018 16:16:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZogm8D6i4lnAhCBsC6guOcWp/D4c1jR69BJMfxKo0AcdDFwUAKtZMV+7eLIP2TCZhRawbUS X-Received: by 2002:a63:4285:: with SMTP id p127-v6mr34619561pga.421.1525821378453; Tue, 08 May 2018 16:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525821378; cv=none; d=google.com; s=arc-20160816; b=Z5uONylTcWyQr1ke4aFYkzjNIx/hMhv7D6Tay0UmgQp+73rgPB0ckSqwWRPkOyRB1F tTQMcfQets0MTxUz2qzWYiMywKG0H/sO98m/LGkoycsYm8TOEHpgZJt7RnoTtcoG8Gwa wcCyx93k+rjBBEy2ICkmTnKMGhm1nE8h1zc0X8DaLqCRI6i3/aTcWXtxnMBygy+kQ7Fq AnHBiMuyCR4E8aYOcOLLHM85i6YJIh3XNU9/DxlL+jxK/iZ1vx4tfbRbzIHnj0iPjI8g 3Bim7cTAW2leQPjOGCEU/Ti6LwhYcomdDYcccWSxFB9G6J/IEY07KiLwTrQQBUXprtIu ei3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=bxR0SGLdw/o0h2JNS4h0/CY0Z7hAe5X8/RC2ZbzWOlw=; b=Qg2enmlso5k65Hachh+WHDjBziXyvzbp83tDhSVgevMMznwP/VY4CocZwpaOzq0/mG 21BoK/25G7jCz31e3kLc2C1fqSVNOTO9S0daX0PtI2dS4t/WrPS5hjyEUnlBOPNtR+n/ /mVdIh2Pa7WI8XHz2rbidvhC0xO6KvFUxl89LRvMc4Lx2NyIi33ohzqC8Ke+HIV2MI2m dszTS45B38zUbjq8oga5mK3xqM85GWf+45SIozwvi9I8T13MpME4cnPEyBe9SJW56MNc owkaA30yiUqszqU0ruCXQOmzr2v6pDAOqwnlgB7mL4359BAY5gc3f2dDtJbXyIP2Knwh LY5Q== 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 t23-v6si23277010plo.508.2018.05.08.16.16.04; Tue, 08 May 2018 16:16:18 -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 S1756025AbeEHXPq (ORCPT + 99 others); Tue, 8 May 2018 19:15:46 -0400 Received: from ale.deltatee.com ([207.54.116.67]:33946 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754148AbeEHXPn (ORCPT ); Tue, 8 May 2018 19:15:43 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fGBpM-0001BV-C3; Tue, 08 May 2018 17:15:25 -0600 To: Dan Williams , Alex Williamson Cc: Stephen Bates , =?UTF-8?Q?Christian_K=c3=b6nig?= , Bjorn Helgaas , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-rdma@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "linux-block@vger.kernel.org" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt References: <20180423233046.21476-1-logang@deltatee.com> <20180423233046.21476-5-logang@deltatee.com> <20180507231306.GG161390@bhelgaas-glaptop.roam.corp.google.com> <0b4183ef-e720-204b-9e85-b9eaf7a4136a@deltatee.com> <3584a6ac-95c7-5d23-1859-aee30605776e@deltatee.com> <20180508133407.57a46902@w520.home> <5fc9b1c1-9208-06cc-0ec5-1f54c2520494@deltatee.com> <20180508141331.7cd737cb@w520.home> <20180508144341.0441b676@w520.home> <20180508152631.50fd583c@w520.home> <354F7407-0DC7-470C-B9AA-74FDF9C46B08@raithlin.com> <20180508160336.0935ddde@w520.home> <20905682-9440-7d4b-0260-99d3dc794c3d@deltatee.com> <20180508163206.7d3bf383@w520.home> From: Logan Gunthorpe Message-ID: <2ce7908d-1422-55f8-aeba-94ccce2cb484@deltatee.com> Date: Tue, 8 May 2018 17:15:21 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: benh@kernel.crashing.org, jglisse@redhat.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, helgaas@kernel.org, christian.koenig@amd.com, sbates@raithlin.com, alex.williamson@redhat.com, dan.j.williams@intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/18 05:00 PM, Dan Williams wrote: >> I'd advise caution with a user supplied BDF approach, we have no >> guaranteed persistence for a device's PCI address. Adding a device >> might renumber the buses, replacing a device with one that consumes >> more/less bus numbers can renumber the buses, motherboard firmware >> updates could renumber the buses, pci=assign-buses can renumber the >> buses, etc. This is why the VT-d spec makes use of device paths when >> describing PCI hierarchies, firmware can't know what bus number will be >> assigned to a device, but it does know the base bus number and the path >> of devfns needed to get to it. I don't know how we come up with an >> option that's easy enough for a user to understand, but reasonably >> robust against hardware changes. Thanks, > > True, but at the same time this feature is for "users with custom > hardware designed for purpose", I assume they would be willing to take > on the bus renumbering risk. It's already the case that > /sys/bus/pci/drivers//bind takes BDF, which is why it seemed to > make a similar interface for the command line. Ideally we could later > get something into ACPI or other platform firmware to arrange for > bridges to disable ACS by default if we see p2p becoming a > common-off-the-shelf feature. I.e. a BIOS switch to enable p2p in a > given PCI-E sub-domain. Yeah, I'm having a hard time coming up with an easy enough solution for the user. I agree with Dan though, the bus renumbering risk would be fairly low in the custom hardware seeing the switches are likely going to be directly soldered to the same board with the CPU. That being said, I supposed we could allow the command line to take both a BDF or a BaseBus/DF/DF/DF path. Though, implementing this sounds like a bit of a challenge. Logan