misc: mic: SCIF RMA nodeqp and minor miscellaneous changes
This patch adds the SCIF kernel node QP control messages required to enable SCIF RMAs. Examples of such node QP control messages include registration, unregistration, remote memory allocation requests, remote memory unmap and SCIF remote fence requests. The patch also updates the SCIF driver with minor changes required to enable SCIF RMAs by adding the new files to the build, initializing RMA specific information during SCIF endpoint creation, reserving SCIF DMA channels, initializing SCIF RMA specific global data structures, adding the IOCTL hooks required for SCIF RMAs and updating RMA specific debugfs hooks. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
564c8d8dfc
commit
d18243293a
@@ -80,7 +80,7 @@ scif_unmap_single(dma_addr_t local, struct scif_dev *scifdev,
|
||||
size_t size)
|
||||
{
|
||||
if (!scifdev_self(scifdev)) {
|
||||
if (scifdev_is_p2p(scifdev) && local > scifdev->base_addr)
|
||||
if (scifdev_is_p2p(scifdev))
|
||||
local = local - scifdev->base_addr;
|
||||
dma_unmap_single(&scifdev->sdev->dev, local,
|
||||
size, DMA_BIDIRECTIONAL);
|
||||
@@ -110,4 +110,27 @@ scif_iounmap(void *virt, size_t len, struct scif_dev *scifdev)
|
||||
sdev->hw_ops->iounmap(sdev, (void __force __iomem *)virt);
|
||||
}
|
||||
}
|
||||
|
||||
static __always_inline int
|
||||
scif_map_page(dma_addr_t *dma_handle, struct page *page,
|
||||
struct scif_dev *scifdev)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (scifdev_self(scifdev)) {
|
||||
*dma_handle = page_to_phys(page);
|
||||
} else {
|
||||
struct scif_hw_dev *sdev = scifdev->sdev;
|
||||
*dma_handle = dma_map_page(&sdev->dev,
|
||||
page, 0x0, PAGE_SIZE,
|
||||
DMA_BIDIRECTIONAL);
|
||||
if (dma_mapping_error(&sdev->dev, *dma_handle))
|
||||
err = -ENOMEM;
|
||||
else if (scifdev_is_p2p(scifdev))
|
||||
*dma_handle = *dma_handle + scifdev->base_addr;
|
||||
}
|
||||
if (err)
|
||||
*dma_handle = 0;
|
||||
return err;
|
||||
}
|
||||
#endif /* SCIF_MAP_H */
|
||||
|
Reference in New Issue
Block a user