Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp56076imm; Tue, 17 Jul 2018 13:54:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNDg9I6kTBdjh8pJ0Gp3AuLvoVee6kN4ZpPZt8QCMwXG8kLSuDWj0FdjVD4fwmzVDoRrfi X-Received: by 2002:aa7:808f:: with SMTP id v15-v6mr2301641pff.38.1531860868989; Tue, 17 Jul 2018 13:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531860868; cv=none; d=google.com; s=arc-20160816; b=MYhB/BmAxlmZuFjYp8gNd59jxiApTt59/K4ZUdj+wAjeks8qNlJpNcj3yvxySYQm6J +lQX2hSFXGNAKnCNVWex/fGbLGJ4b8TQA1hJ8yjdzMLMiLnpNO0nNlFi0O4exEzSmlCE VMJNbjNm8aQz0dRwe6H4WllVIwUp5mgfU6T/94ZxU1QlGcTsI7d5U7hWxpjAiOHc04cB 1YRSupHnOG1GTnXBr/o+3Fi2jh8/FZUEQy3G1wQ5HK1KVsGgGEFycszIHqA/mcXanUGU jFjMEFbb4ST0UixjViQ2Y5siuJ9oTOFI0RJHH5rDc98DRfP5pssxusX8JJS8WKKac1HA nO0Q== 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=JJZcuzd0o3Z15MMUbX02erW0M/+LLBt6wcVlhxdfBHQ=; b=s6HS8pGIhRT07gn83/b0UzbwyKIgoxmWnrFAjvL5ZaztY+wHt3FzbEfGkOx2zltcqK AhcJqpGE0Cxt2i0ZeUJ1mR3SPeGaWSFrdQ7RP3mPpf0zyFEvLz0PQFvWlgDxeYOFnAoa 9ihNvMzWrGwDwsDIm/JvHqNxT97Rpc48dzn75ngudo3aMJTtLlhBnIHoDQe25nd4iq3z 1DKvIyi6WJoo5UPvoMb+BQSvLraj0LDIAgpk45DX4r5wu0+Q5iZ+L3bnKu8Ih7cGD4XP vMRPzkmQSCYifl6o3/QafH3LWVka448CfZkJmrC329l/FbUJVGGncp5TKNkvWoE5ZPSL kfeQ== 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 x68-v6si1705897pfc.239.2018.07.17.13.54.12; Tue, 17 Jul 2018 13:54:28 -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 S1730429AbeGQV03 (ORCPT + 99 others); Tue, 17 Jul 2018 17:26:29 -0400 Received: from ale.deltatee.com ([207.54.116.67]:46384 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729478AbeGQV03 (ORCPT ); Tue, 17 Jul 2018 17:26:29 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1ffWwn-0000hi-8V; Tue, 17 Jul 2018 14:51:50 -0600 To: Matthew Wilcox , Martin Mares Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, Stephen Bates , Christoph Hellwig , Bjorn Helgaas , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , "Paul E. McKenney" , Marc Zyngier , Kai-Heng Feng , Frederic Weisbecker , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20180717170204.30470-1-logang@deltatee.com> <20180717203900.GA1771@bombadil.infradead.org> From: Logan Gunthorpe Message-ID: <1e1f1e0d-520a-e2f9-15cb-09e97cd4a836@deltatee.com> Date: Tue, 17 Jul 2018 14:51:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180717203900.GA1771@bombadil.infradead.org> 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: christian.koenig@amd.com, alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, frederic@kernel.org, kai.heng.feng@canonical.com, marc.zyngier@arm.com, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, mingo@kernel.org, corbet@lwn.net, bhelgaas@google.com, hch@lst.de, sbates@raithlin.com, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mj@ucw.cz, willy@infradead.org 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: lspci: Display path to device 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 17/07/18 02:39 PM, Matthew Wilcox wrote: > On Tue, Jul 17, 2018 at 11:02:00AM -0600, Logan Gunthorpe wrote: >> The second patch expands the new helper to optionally take a path of >> PCI devfns. This is to address Alex's renumbering concern when using >> simple bus-devfns. The implementation is essentially how he described it and >> similar to the Intel VT-d spec (Section 8.3.1). > > I don't like telling the user to grovel around lspci -t by hand. It's > not many lines of code to add a new -P option to lspci to show the path > to each device instead of bus:dev.fn Thanks, this looks great! I also found parsing the lspci -t output cumbersome. I've also got patches pending for switchtec-user[1] that help users find the path of downstream ports for Microsemi switches. (An example is shown below). As the ACS feature is primarily for PCI switch users, this should help a good segment of people. The lspci patches should cover a lot more people though. Logan sudo switchtec status /dev/switchtec0 -v Partition 0: (LOCAL) Logical Port ID 0 (USP): Phys Port ID: 32 (Stack 4, Port 0) Bus-Dev-Func: 0000:02:00.0 Bus-Dev-Func Path: 0000:00:02:0/00.0 Status: UP LTSSM: L0 Max-Width: x16 Neg Width: x16 Rate: Gen3 - 8 GT/s 15.76 GB/s Out Bytes: 70.3 GB In Bytes: 70.8 GB Logical Port ID 1 (DSP): Phys Port ID: 8 (Stack 1, Port 0) Bus-Dev-Func: 0000:03:00.0 Bus-Dev-Func Path: 0000:00:02:0/00.0/00.0 Status: UP LTSSM: L0 Max-Width: x8 Neg Width: x8 Rate: Gen3 - 8 GT/s 7.88 GB/s Out Bytes: 12.2 MB In Bytes: 441 MB ACS: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans- Device: 10b5:8724 (0000:04:00.0) 0000:05 Logical Port ID 2 (DSP): Phys Port ID: 12 (Stack 1, Port 4) Bus-Dev-Func: 0000:03:01.0 Bus-Dev-Func Path: 0000:00:02:0/00.0/01.0 Status: UP LTSSM: L0 Max-Width: x8 Neg Width: x8 Rate: Gen3 - 8 GT/s 7.88 GB/s Out Bytes: 1.65 MB In Bytes: 107 MB ACS: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans- Device: 11f8:f117 (0000:0b:00.0) nvme4 [1] https://github.com/Microsemi/switchtec-user/pull/25