On Mon, Sep 28, 2026 at 10:27:32AM +0200, Christian König wrote:
In general I think that the sg_alloc_table_from_pages_segment() approach is because of the broken design of the old DMA API.
The scatterlist and the DMA API use of it is very specialized to serve the needs of the storage stack without performance cost. Segmentation is intended to make the sgl entries map 1:1 to HW entries so the block layer can schedule correctly.
Nothing else needs something like this but still has to tip toe around these rules. It makes it more complicated to map and then in some cases you have to undo it when programming HW :\
Reviewed-by: Jason Gunthorpe jgg@nvidia.com
Jason