2 * QEMU paravirtual RDMA - Generic RDMA backend
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
8 * Yuval Shaia <yuval.shaia@oracle.com>
9 * Marcel Apfelbaum <marcel@redhat.com>
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
16 #include "rdma_utils.h"
18 void *rdma_pci_dma_map(PCIDevice
*dev
, dma_addr_t addr
, dma_addr_t plen
)
24 pr_dbg("addr is NULL\n");
28 p
= pci_dma_map(dev
, addr
, &len
, DMA_DIRECTION_TO_DEVICE
);
30 pr_dbg("Fail in pci_dma_map, addr=0x%" PRIx64
", len=%" PRId64
"\n",
36 rdma_pci_dma_unmap(dev
, p
, len
);
40 pr_dbg("0x%" PRIx64
" -> %p (len=% " PRId64
")\n", addr
, p
, len
);
45 void rdma_pci_dma_unmap(PCIDevice
*dev
, void *buffer
, dma_addr_t len
)
47 pr_dbg("%p\n", buffer
);
49 pci_dma_unmap(dev
, buffer
, len
, DMA_DIRECTION_TO_DEVICE
, 0);