On 2021-04-27 1:47 p.m., Jason Gunthorpe wrote: > On Thu, Apr 08, 2021 at 11:01:21AM -0600, Logan Gunthorpe wrote: >> Ensure the dma operations support p2pdma before using the RDMA >> device for P2PDMA. This allows switching the RDMA driver from >> pci_p2pdma_map_sg() to dma_map_sg_p2pdma(). >> >> Signed-off-by: Logan Gunthorpe <[email protected]> >> drivers/nvme/target/rdma.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c >> index 6c1f3ab7649c..3ec7e77e5416 100644 >> +++ b/drivers/nvme/target/rdma.c >> @@ -414,7 +414,8 @@ static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device >> *ndev, >> if (ib_dma_mapping_error(ndev->device, r->send_sge.addr)) >> goto out_free_rsp; >> >> - if (!ib_uses_virt_dma(ndev->device)) >> + if (!ib_uses_virt_dma(ndev->device) && >> + dma_pci_p2pdma_supported(&ndev->device->dev)) > > ib_uses_virt_dma() should not be called by nvme and this is using the > wrong device pointer to query for DMA related properties. > > I suspect this wants a ib_dma_pci_p2p_dma_supported() wrapper like > everything else. Makes sense. Will add for v2. Logan _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
- Re: [PATCH 04/16] PCI/P2PDMA: Refactor pci_p2pdma_map... John Hubbard
- Re: [PATCH 04/16] PCI/P2PDMA: Refactor pci_p2pdma... Logan Gunthorpe
- Re: [PATCH 04/16] PCI/P2PDMA: Refactor pci_p2... John Hubbard
- Re: [PATCH 04/16] PCI/P2PDMA: Refactor pc... Logan Gunthorpe
- Re: [PATCH 04/16] PCI/P2PDMA: Refact... John Hubbard
- Re: [PATCH 04/16] PCI/P2PDMA: Re... Jason Gunthorpe
- Re: [PATCH 04/16] PCI/P2PDMA: Re... John Hubbard
- [PATCH 15/16] RDMA/rw: use dma_map_sg_p2pdma() Logan Gunthorpe
- [PATCH 14/16] nvme-rdma: Ensure dma support when using p2p... Logan Gunthorpe
- Re: [PATCH 14/16] nvme-rdma: Ensure dma support when ... Jason Gunthorpe
- Re: [PATCH 14/16] nvme-rdma: Ensure dma support w... Logan Gunthorpe
- Re: [PATCH 14/16] nvme-rdma: Ensure dma support when ... John Hubbard
- [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages in dma-i... Logan Gunthorpe
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages... Jason Gunthorpe
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA p... Logan Gunthorpe
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages... John Hubbard
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA p... Logan Gunthorpe
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA pages... Don Dutile
- Re: [PATCH 11/16] iommu/dma: Support PCI P2PDMA p... Logan Gunthorpe
- [PATCH 03/16] PCI/P2PDMA: Attempt to set map_type if it ha... Logan Gunthorpe
