On Wed, Mar 11, 2020 at 03:43:03PM +0100, Christian König wrote: > > > > int 'p2pdma map bar'( > > > > struct pci_device *source, > > > > unsigned int source_bar_number, > > > > struct pci_device *dest, > > > > physaddr&len *array_of_offsets & length pairs into source bar, > > > > struct scatterlist *output_sgl) > > > Well that's exactly what I have to avoid since I don't have the array of > > > offsets around and want to avoid constructing it. > > Maybe it doesn't need an array of offsets - just a single offset and > > callers can iterate the API? > > Yes, that would of course work as well. > > But I was assuming that p2pdma_map_bar() needs some state between those > calls. It might be able to run faster if some state is held. We've had APIs before where the caller can provide a cache for expensive state for APIs. Maybe that would be an appropriate pattern here? IIRC the distance calculation is the expensive bit, that would be easy enough to cache. Jason _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel