27 #include <linux/vfio.h>
28 #include <sys/ioctl.h>
54 const char *write_data)
65 "No stateful region was configured for type. Please configure at least 1 stateful region to run this sample");
92 DOCA_LOG_INFO(
"Reading stateful region at bar %u start address %zu size %zuB:\n%s",
100 DOCA_LOG_INFO(
"Writing to stateful region at bar %u start address %zu size %zuB:\n",
104 memcpy(stateful_region->
mem, write_data, data_len);
doca_error_t devemu_pci_device_stateful_region_host(const char *pci_address, int vfio_group, int region_index, const char *write_data)
DOCA_LOG_REGISTER(DEVEMU_PCI_DEVICE_STATEFUL_REGION_HOST)
void devemu_host_resources_cleanup(struct devemu_host_resources *resources)
doca_error_t map_bar_region_memory(struct devemu_host_resources *resources, const struct bar_region_config *bar_region_config, struct bar_mapped_region *mapped_mem)
doca_error_t init_vfio_device(struct devemu_host_resources *resources, int vfio_group, const char *pci_address)
struct rdma_resources resources
enum doca_error doca_error_t
DOCA API return codes.
@ DOCA_ERROR_INVALID_VALUE
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
char * hex_dump(const void *data, size_t size)
#define PCI_TYPE_NUM_BAR_STATEFUL_REGIONS
#define PCI_TYPE_MAX_STATEFUL_REGION_SIZE
static const struct bar_region_config stateful_configs[PCI_TYPE_NUM_BAR_STATEFUL_REGIONS]