summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/rw.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2019-08-12 19:30:43 +0200
committerBjorn Helgaas <bhelgaas@google.com>2019-08-16 15:41:26 +0200
commit7f73eac3a7137eabfb0c005c7ba55eb7994b9673 (patch)
tree71b1700c9f04a1a35c9abdc59a4b7104dff03901 /drivers/infiniband/core/rw.c
parentPCI/P2PDMA: Add attrs argument to pci_p2pdma_map_sg() (diff)
downloadlinux-7f73eac3a7137eabfb0c005c7ba55eb7994b9673.tar.xz
linux-7f73eac3a7137eabfb0c005c7ba55eb7994b9673.zip
PCI/P2PDMA: Introduce pci_p2pdma_unmap_sg()
Add pci_p2pdma_unmap_sg() to the two places that call pci_p2pdma_map_sg(). This is a prep patch to introduce correct mappings for p2pdma transactions that go through the root complex. Link: https://lore.kernel.org/r/20190730163545.4915-10-logang@deltatee.com Link: https://lore.kernel.org/r/20190812173048.9186-10-logang@deltatee.com Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/infiniband/core/rw.c')
-rw-r--r--drivers/infiniband/core/rw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index dce06108c8c3..5337393d4dfe 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -583,8 +583,10 @@ void rdma_rw_ctx_destroy(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num,
break;
}
- /* P2PDMA contexts do not need to be unmapped */
- if (!is_pci_p2pdma_page(sg_page(sg)))
+ if (is_pci_p2pdma_page(sg_page(sg)))
+ pci_p2pdma_unmap_sg(qp->pd->device->dma_device, sg,
+ sg_cnt, dir);
+ else
ib_dma_unmap_sg(qp->pd->device, sg, sg_cnt, dir);
}
EXPORT_SYMBOL(rdma_rw_ctx_destroy);