 
            On Tue, Oct 28, 2025 at 03:14:32PM +0100, Christian König wrote:
On 10/28/25 15:05, Jason Gunthorpe wrote:
On Tue, Oct 28, 2025 at 02:58:57PM +0100, Christian König wrote:
Some kind of iterator like interface would be preferred where you have first and next callbacks.
That's what I thought you were asking for..
Are you sure that is what you want? It will make mapping of fragments alot slower..
Well the first function should have a start parameter and both return offset and length.
At least RDMA doesn't want this, we need to see the whole list to make calculations on the shape of the HW page table to allocate.
Alternatively we could come up with some container, but yeah then we would need to convert into the container format again.
Well, given we won't get away from scatterlist in the near term lets start out by having per "mapping type" functions that return something natural and type-correct for their types and see where that brings us. Starting with scatterlist..
Once we have the new interface people can propose alternative "mapping types" and we can see benchmarks.
For this vfio stuff a kvalloc() flat array is likely good enough. Most use case will be single range.
Jason