[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241107135025.GA14996@lst.de>
Date: Thu, 7 Nov 2024 14:50:25 +0100
From: Christoph Hellwig <hch@....de>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Christoph Hellwig <hch@....de>, Robin Murphy <robin.murphy@....com>,
Leon Romanovsky <leon@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Sagi Grimberg <sagi@...mberg.me>, Keith Busch <kbusch@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Logan Gunthorpe <logang@...tatee.com>,
Yishai Hadas <yishaih@...dia.com>,
Shameer Kolothum <shameerali.kolothum.thodi@...wei.com>,
Kevin Tian <kevin.tian@...el.com>,
Alex Williamson <alex.williamson@...hat.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Jérôme Glisse <jglisse@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
linux-rdma@...r.kernel.org, iommu@...ts.linux.dev,
linux-nvme@...ts.infradead.org, linux-pci@...r.kernel.org,
kvm@...r.kernel.org, linux-mm@...ck.org, matthew.brost@...el.com,
Thomas.Hellstrom@...ux.intel.com, brian.welty@...el.com,
himal.prasad.ghimiray@...el.com, krishnaiah.bommu@...el.com,
niranjana.vishwanathapura@...el.com
Subject: Re: [PATCH v1 00/17] Provide a new two step DMA mapping API
On Thu, Nov 07, 2024 at 09:28:08AM -0400, Jason Gunthorpe wrote:
> Once we are freed from scatterlist we can explore a design that would
> pass the P2P routing information directly. For instance imagine
> something like:
>
> dma_map_p2p(dev, phys, p2p_provider);
>
> Then dma_map_page(dev, page) could be something like
>
> if (is_pci_p2pdma_page(page))
> dev_map_p2p(dev, page_to_phys(page), page->pgmap->p2p_provider)
One thing that this series does is to move the P2P mapping decisions out
of the low-level dma mapping helpers and into the caller (again) for
the non-sg callers and moves the special switch based bus mapping into
a routine that can be called directly.
Take a look at blk_rq_dma_map_iter_start, which now literally uses
dma_map_page for the no-iommu, no-switch P2P case. It also is a good
use case for the proposed dma_map_phys.
> GPU driver
>
> https://lore.kernel.org/dri-devel/20240117221223.18540-7-oak.zeng@intel.com/
Eww, that's horrible. Converting this to Leon's new hmm helpers
would be really nice (and how that they are useful for more than
mlx5).
Powered by blists - more mailing lists