From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B455C0650F for ; Thu, 8 Aug 2019 15:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42140217F4 for ; Thu, 8 Aug 2019 15:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390176AbfHHP7S (ORCPT ); Thu, 8 Aug 2019 11:59:18 -0400 Received: from ale.deltatee.com ([207.54.116.67]:55280 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390115AbfHHP7R (ORCPT ); Thu, 8 Aug 2019 11:59:17 -0400 Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hvkoc-00029F-KI; Thu, 08 Aug 2019 09:58:59 -0600 To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, Bjorn Helgaas , Christian Koenig , Jason Gunthorpe , Sagi Grimberg , Keith Busch , Jens Axboe , Dan Williams , Eric Pilmore , Stephen Bates References: <20190730163545.4915-1-logang@deltatee.com> <20190730163545.4915-4-logang@deltatee.com> <20190807055455.GA6627@lst.de> <4b0c012a-c3a1-a1c0-b098-8b350963aed1@deltatee.com> <20190808073109.GC29852@lst.de> From: Logan Gunthorpe Message-ID: Date: Thu, 8 Aug 2019 09:58:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190808073109.GC29852@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: sbates@raithlin.com, epilmore@gigaio.com, dan.j.williams@intel.com, axboe@fb.com, kbusch@kernel.org, sagi@grimberg.me, jgg@mellanox.com, Christian.Koenig@amd.com, bhelgaas@google.com, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v2 03/14] PCI/P2PDMA: Add constants for not-supported result upstream_bridge_distance() 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 2019-08-08 1:31 a.m., Christoph Hellwig wrote: > On Wed, Aug 07, 2019 at 09:58:06AM -0600, Logan Gunthorpe wrote: >> We only calculate it at the same time as we calculate the distance. This >> is necessary because, to calculate the type, we have to walk the tree >> and check the ACS bits. If we separated it, we'd have to walk the tree >> twice in a very similar way just to determine both the distance and the >> mapping type. > > Calculating it together makes perfect sense. What I find odd is the > overloading of a single return value. Why not return the map type as > the return value, and the distance as a by reference argument to keep > them properly separated? Ok, understood. I'll make that change and send some incremental patches to Bjorn tomorrow. Logan