On 2021-03-11 4:59 p.m., Jason Gunthorpe wrote: > On Thu, Mar 11, 2021 at 04:31:41PM -0700, Logan Gunthorpe wrote: >> Convert to using dma_[un]map_sg() for PCI p2pdma pages. >> >> This should be equivalent, though support will be somewhat less >> (only dma-direct and dma-iommu are currently supported). >> >> Signed-off-by: Logan Gunthorpe <log...@deltatee.com> >> drivers/nvme/host/pci.c | 27 +++++++-------------------- >> 1 file changed, 7 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c >> index 7d40c6a9e58e..89ca5acf7a62 100644 >> +++ b/drivers/nvme/host/pci.c >> @@ -577,17 +577,6 @@ static void nvme_free_sgls(struct nvme_dev *dev, struct >> request *req) >> >> } >> >> -static void nvme_unmap_sg(struct nvme_dev *dev, struct request *req) >> -{ >> - struct nvme_iod *iod = blk_mq_rq_to_pdu(req); >> - >> - if (is_pci_p2pdma_page(sg_page(iod->sg))) >> - pci_p2pdma_unmap_sg(dev->dev, iod->sg, iod->nents, >> - rq_dma_dir(req)); >> - else >> - dma_unmap_sg(dev->dev, iod->sg, iod->nents, rq_dma_dir(req)); >> -} > > Can the two other places with this code pattern be changed too? Yes, if this goes forward, I imagine completely dropping pci_p2pdma_unmap_sg(). Logan
- [RFC PATCH v2 02/11] PCI/P2PDMA: Avoid pci_get_slot() whic... Logan Gunthorpe
- [RFC PATCH v2 07/11] dma-mapping: Add flags to dma_map_ops... Logan Gunthorpe
- [RFC PATCH v2 06/11] dma-direct: Support PCI P2PDMA pages ... Logan Gunthorpe
- Re: [RFC PATCH v2 06/11] dma-direct: Support PCI P2PD... Robin Murphy
- Re: [RFC PATCH v2 06/11] dma-direct: Support PCI ... Logan Gunthorpe
- Re: [RFC PATCH v2 06/11] dma-direct: Support ... Robin Murphy
- Re: [RFC PATCH v2 06/11] dma-direct: Supp... Logan Gunthorpe
- [RFC PATCH v2 09/11] block: Add BLK_STS_P2PDMA Logan Gunthorpe
- [RFC PATCH v2 11/11] nvme-pci: Convert to using dma_map_sg... Logan Gunthorpe
- Re: [RFC PATCH v2 11/11] nvme-pci: Convert to using d... Jason Gunthorpe
- Re: [RFC PATCH v2 11/11] nvme-pci: Convert to usi... Logan Gunthorpe
- [RFC PATCH v2 01/11] PCI/P2PDMA: Pass gfp_mask flags to up... Logan Gunthorpe
- Re: [RFC PATCH v2 01/11] PCI/P2PDMA: Pass gfp_mask fl... Bjorn Helgaas
- Re: [RFC PATCH v2 01/11] PCI/P2PDMA: Pass gfp_mas... Logan Gunthorpe
- [RFC PATCH v2 03/11] PCI/P2PDMA: Attempt to set map_type i... Logan Gunthorpe
- Re: [RFC PATCH v2 00/11] Add support to dma_map_sg for P2P... Robin Murphy
- Re: [RFC PATCH v2 00/11] Add support to dma_map_sg fo... Logan Gunthorpe
- Re: [RFC PATCH v2 00/11] Add support to dma_map_s... Robin Murphy
- Re: [RFC PATCH v2 00/11] Add support to dma_m... Logan Gunthorpe