Received: by 10.192.165.148 with SMTP id m20csp198242imm; Fri, 4 May 2018 08:53:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqE40NUPLiVwV7MqRMqtRoxMaWD17xcMvjTyr+W97qz2eIiuYvr16Qaik8Nz+/EwfPrPgh7 X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr29213661plg.38.1525449206867; Fri, 04 May 2018 08:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525449206; cv=none; d=google.com; s=arc-20160816; b=bQvJ+2FV1agH7aeZ5b9ac81oDbZBO/JU3fC6xodPB3Q5FLU/tb9MBcgXfMhx+MUdrb pXlzdOn0sEUxJtst7PgLlWeX82Es2znU8ytOjtgvJcoD7d66m+t4eFEjzTEoDuRKh8HL jjqbzWorDBgAJJew3SJ5pJrg2JZRQ2KCjIiiB1OiQHBv52XrVnxCmVA18KClHkXVbBGg woPa6GrMwwJ2Tg3/JHgoQUxyHBxOgdu29dqf5iJ4jpyrcwdAUS8ZSU7gwNviubnseJmq b27ukywrsEWTVEZLBRYSnXypcwNHPHBj6DgW5Gdz/CcuJHE0Au7k2LGU9F08l3DwOLg4 gI1A== 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=meKAFICUbLVtUAvObUT/7M7Srgd1OGaYpyspX6xvZAc=; b=kmxa+TW9oU4x9JybDYMxX+NPa3GDoja8wG5krVGVoMTyacsY4XBPtUzp4CVxWxzuwG TQ/oRvfNha+FHg5NwhaOWLb2200/UE7JTrqzkmPYwdrOHMfjh6+4204tlG0dLFzEVlTQ jUCoFCZOZ2TtPjtbMmrQWPHXzFjtDQhTvy6qbtQyuZ1UP+ytJEaxWAy3elcKNE9ne8cI iWSgnvQStyBmfpU8xFx4E/ya/Ol5X7Rv7AlRu75CmS+OEtcIZnMLcChu8dqGU95k5WZ2 3k5hNayYBPm8UX8A6I/EuIxqh+fv+Z06JTC5A9iXVIRA6ylx63AkDQ547zSuc3B2cC4S jGUA== 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 n3-v6si10381674pgp.344.2018.05.04.08.53.12; Fri, 04 May 2018 08:53:26 -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 S1751502AbeEDPxA (ORCPT + 99 others); Fri, 4 May 2018 11:53:00 -0400 Received: from ale.deltatee.com ([207.54.116.67]:60810 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbeEDPw6 (ORCPT ); Fri, 4 May 2018 11:52:58 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fEd0e-00074S-9S; Fri, 04 May 2018 09:52:37 -0600 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , 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 Cc: Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson References: <20180423233046.21476-1-logang@deltatee.com> <805645c1-ea40-2e57-88eb-5dd34e579b2e@deltatee.com> <3e4e0126-f444-8d88-6793-b5eb97c61f76@amd.com> <38d866cf-f7b4-7118-d737-5a5dcd9f3784@amd.com> <2d59aa02-f2fa-bd88-1b6c-923117a6ad28@deltatee.com> <17e7bc28-f499-c7f7-f91a-9f6778de5fd3@amd.com> From: Logan Gunthorpe Message-ID: Date: Fri, 4 May 2018 09:52:26 -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: <17e7bc28-f499-c7f7-f91a-9f6778de5fd3@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, sbates@raithlin.com, 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, christian.koenig@amd.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 00/14] Copy Offload in NVMe Fabrics with P2P PCI Memory 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 04/05/18 08:27 AM, Christian König wrote: > Are you sure that this is more convenient? At least on first glance it > feels overly complicated. > > I mean what's the difference between the two approaches? > >     sum = pci_p2pdma_distance(target, [A, B, C, target]); > > and > >     sum = pci_p2pdma_distance(target, A); >     sum += pci_p2pdma_distance(target, B); >     sum += pci_p2pdma_distance(target, C); Well, it's more for consistency with the pci_p2pdma_find() which has to take a list of devices to find a resource which matches all of them. (You can't use multiple calls in that case because all the devices in the list might not have the same set of compatible providers.) That way we can use the same list to check the distance (when the user specifies a device) as we do to find a compatible device (when the user wants to automatically find one. Logan