46 struct doca_devemu_vfs_type *
vfs_type;
94 struct doca_devinfo **dev_list;
109 for (i = 0; i < nb_devs; i++) {
134 switch (pci_func_type) {
145 return "Invalid pci function type";
157 uint32_t num_devices = 0;
158 struct doca_devinfo_rep **dev_list_rep =
NULL;
173 for (i = 0; i < num_devices; i++) {
191 DOCA_LOG_INFO(
"Idx:%d, vuid:%s pci_addr:%s pci_func_type:%s",
static void state_cleanup(struct program_state *state)
doca_error_t devemu_vfs_device_list(const char *pci_address)
static const char * rep_func_type_to_string(enum doca_pci_func_type pci_func_type)
static bool device_match_pci_addr(const struct doca_devinfo *devinfo, const char *pci_address)
static doca_error_t list_emulated_devices(struct doca_devemu_vfs_type *vfs_type)
DOCA_LOG_REGISTER(DPU_DEVEMU_VFS_DEVICE_LIST)
static doca_error_t find_doca_device(const char *pci_address, struct doca_dev **dev)
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_create_rep_list(struct doca_devemu_pci_type *pci_type, struct doca_devinfo_rep ***dev_list_rep, uint32_t *nb_devs_rep)
Create list of available representor devices for a given DOCA devemu PCI type.
DOCA_EXPERIMENTAL struct doca_devemu_pci_type * doca_devemu_vfs_type_as_pci_type(struct doca_devemu_vfs_type *vfs_type)
Convert DOCA Virtio FS type instance into DOCA PCI type.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_vfs_find_default_vfs_type_by_dev(struct doca_dev *dev, struct doca_devemu_vfs_type **vfs_type)
Find the default DOCA Virtio FS type associated with the device.
DOCA_STABLE doca_error_t doca_devinfo_is_equal_pci_addr(const struct doca_devinfo *devinfo, const char *pci_addr_str, uint8_t *is_equal)
Check if a PCI address belongs to a DOCA devinfo.
DOCA_STABLE doca_error_t doca_devinfo_rep_destroy_list(struct doca_devinfo_rep **dev_list_rep)
Destroy list of representor device info structures.
DOCA_STABLE doca_error_t doca_devinfo_create_list(struct doca_devinfo ***dev_list, uint32_t *nb_devs)
Creates list of all available local devices.
#define DOCA_DEVINFO_REP_PCI_ADDR_SIZE
Buffer size to hold PCI BDF format: "XXXX:XX:XX.X". Including a null terminator.
DOCA_STABLE doca_error_t doca_devinfo_rep_get_vuid(const struct doca_devinfo_rep *devinfo_rep, char *rep_vuid, uint32_t size)
Get the Vendor Unique ID of a representor DOCA devinfo.
DOCA_STABLE doca_error_t doca_devinfo_rep_get_pci_addr_str(const struct doca_devinfo_rep *devinfo_rep, char *pci_addr_str)
Get the PCI address of a DOCA devinfo_rep.
DOCA_STABLE doca_error_t doca_devinfo_rep_get_pci_func_type(const struct doca_devinfo_rep *devinfo_rep, enum doca_pci_func_type *pci_func_type)
Get the PCI function type of a DOCA devinfo_rep.
#define DOCA_DEVINFO_REP_VUID_SIZE
Buffer size to hold VUID. Including a null terminator.
DOCA_STABLE doca_error_t doca_devinfo_destroy_list(struct doca_devinfo **dev_list)
Destroy list of local device info structures.
DOCA_STABLE doca_error_t doca_dev_open(struct doca_devinfo *devinfo, struct doca_dev **dev)
Initialize local device for use.
DOCA_STABLE doca_error_t doca_dev_close(struct doca_dev *dev)
Destroy allocated local device instance.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_WARN(format,...)
Generates a WARNING application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
doca_pci_func_type
Specifies the PCI function type for DOCA representor device.
struct doca_devemu_vfs_type * vfs_type