From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 MIME-Version: 1.0 In-Reply-To: <17e7bc28-f499-c7f7-f91a-9f6778de5fd3@amd.com> Content-Type: text/plain; charset=utf-8 Subject: Re: [PATCH v4 00/14] Copy Offload in NVMe Fabrics with P2P PCI Memory List-ID: 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