Re: [PATCH v4 00/14] Copy Offload in NVMe Fabrics with P2P PCI Memory

From: Logan Gunthorpe
Date: Fri May 04 2018 - 11:53:03 EST




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