NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
devemu_pci_device_dma_host_sample.c File Reference
#include <devemu_pci_common.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/vfio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <common.h>
#include <doca_error.h>
#include <doca_log.h>
#include <devemu_pci_host_common.h>
Include dependency graph for devemu_pci_device_dma_host_sample.c:

Go to the source code of this file.

Macros

#define MEM_BUF_LEN   (4 * 1024) /* Mem buffer size. It's the same as DPU side */
 

Functions

 DOCA_LOG_REGISTER (DEVEMU_PCI_DEVICE_DMA_HOST)
 
static doca_error_t allocate_dma_mem (struct devemu_host_resources *resources, int len)
 
static doca_error_t map_dma_mem (struct devemu_host_resources *resources, uint64_t iova)
 
static doca_error_t unmap_dma_mem (struct devemu_host_resources *resources, uint64_t iova)
 
doca_error_t devemu_pci_device_dma_host (const char *pci_address, int vfio_group, const char *write_data)
 

Macro Definition Documentation

◆ MEM_BUF_LEN

#define MEM_BUF_LEN   (4 * 1024) /* Mem buffer size. It's the same as DPU side */

Definition at line 44 of file devemu_pci_device_dma_host_sample.c.

Function Documentation

◆ allocate_dma_mem()

static doca_error_t allocate_dma_mem ( struct devemu_host_resources resources,
int  len 
)
static

Definition at line 55 of file devemu_pci_device_dma_host_sample.c.

◆ devemu_pci_device_dma_host()

doca_error_t devemu_pci_device_dma_host ( const char *  pci_address,
int  vfio_group,
const char *  write_data 
)

Definition at line 120 of file devemu_pci_device_dma_host_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( DEVEMU_PCI_DEVICE_DMA_HOST  )

◆ map_dma_mem()

static doca_error_t map_dma_mem ( struct devemu_host_resources resources,
uint64_t  iova 
)
static

Definition at line 74 of file devemu_pci_device_dma_host_sample.c.

◆ unmap_dma_mem()

static doca_error_t unmap_dma_mem ( struct devemu_host_resources resources,
uint64_t  iova 
)
static

Definition at line 97 of file devemu_pci_device_dma_host_sample.c.