]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/core: introduce ib_dma_pci_p2p_dma_supported()
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 8 Jul 2022 16:51:02 +0000 (10:51 -0600)
committerChristoph Hellwig <hch@lst.de>
Tue, 26 Jul 2022 11:28:07 +0000 (07:28 -0400)
commit495758bb1a72316094ee854dc51f667ad3db29b5
tree2c72be9c3fcacde2dfde6e7eb59db6ae03afd171
parent91fb2b6052f75a2f9375db5d5924860ab2313a1d
RDMA/core: introduce ib_dma_pci_p2p_dma_supported()

Introduce the helper function ib_dma_pci_p2p_dma_supported() to check
if a given ib_device can be used in P2PDMA transfers. This ensures
the ib_device is not using virt_dma and also that the underlying
dma_device supports P2PDMA.

Use the new helper in nvme-rdma to replace the existing check for
ib_uses_virt_dma(). Adding the dma_pci_p2pdma_supported() check allows
switching away from pci_p2pdma_[un]map_sg().

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/rdma.c
include/rdma/ib_verbs.h