On 2021-05-14 7:49 a.m., Christoph Hellwig wrote: > On Thu, May 13, 2021 at 04:31:47PM -0600, Logan Gunthorpe wrote: >> Attempt to find the mapping type for P2PDMA pages on the first >> DMA map attempt if it has not been done ahead of time. >> >> Previously, the mapping type was expected to be calculated ahead of >> time, but if pages are to come from userspace then there's no >> way to ensure the path was checked ahead of time. >> >> With this change it's no longer invalid to call pci_p2pdma_map_sg() >> before the mapping type is calculated so drop the WARN_ON when that >> is the case. > > Why? Before this change, the if the mapping type wasn't already calculated pci_p2pdma_map_sg() would just fail. This was fine for NVMe-of as it always called pci_p2pdma_distance() ahead of time which calculated the mapping type, stored it in the xarray and did not proceed if the two devices could not talk to each other. This patch makes it so if the mapping type is not already calculated at dma map time, it does the calculation. This means the dma map operation can fail if the two devices aren't able to talk to each other. Logan _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
- [PATCH v2 22/22] PCI/P2PDMA: Remove pci_p2pdma_[un]map_s... Logan Gunthorpe
- [PATCH v2 14/22] PCI/P2PDMA: Introduce helpers for dma_m... Logan Gunthorpe
- Re: [PATCH v2 14/22] PCI/P2PDMA: Introduce helpers ... Christoph Hellwig
- Re: [PATCH v2 14/22] PCI/P2PDMA: Introduce help... Logan Gunthorpe
- [PATCH v2 11/22] dma-iommu: Return error code from iommu... Logan Gunthorpe
- [PATCH v2 09/22] dma-direct: Return appropriate error co... Logan Gunthorpe
- [PATCH v2 10/22] iommu: Return full error code from iomm... Logan Gunthorpe
- [PATCH v2 12/22] lib/scatterlist: Add flag for indicatin... Logan Gunthorpe
- [PATCH v2 06/22] PCI/P2PDMA: Attempt to set map_type if ... Logan Gunthorpe
- Re: [PATCH v2 06/22] PCI/P2PDMA: Attempt to set map... Christoph Hellwig
- Re: [PATCH v2 06/22] PCI/P2PDMA: Attempt to set... Logan Gunthorpe
- [PATCH v2 08/22] dma-mapping: Allow map_sg() ops to retu... Logan Gunthorpe
- Re: [PATCH v2 08/22] dma-mapping: Allow map_sg() op... Christoph Hellwig
- Re: [PATCH v2 08/22] dma-mapping: Allow map_sg(... Logan Gunthorpe
- [PATCH v2 07/22] PCI/P2PDMA: Refactor pci_p2pdma_map_typ... Logan Gunthorpe
- [PATCH v2 05/22] PCI/P2PDMA: Print a warning if the host... Logan Gunthorpe
- Re: [PATCH v2 00/22] Add new DMA mapping operation for P... Christoph Hellwig
- Re: [PATCH v2 00/22] Add new DMA mapping operation ... Logan Gunthorpe
