NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Device Emulation - PCI Device Types
Collaboration diagram for DOCA Device Emulation - PCI Device Types:

Macros

#define DOCA_DEVEMU_PCI_TYPE_NAME_LEN   32
 Maximal length for the NULL terminated string that describe the name of the emulated PCI device type. More...
 

Enumerations

enum  doca_devemu_pci_bar_mem_type { DOCA_DEVEMU_PCI_BAR_MEM_TYPE_32_BIT = 0 , DOCA_DEVEMU_PCI_BAR_MEM_TYPE_1_MB , DOCA_DEVEMU_PCI_BAR_MEM_TYPE_64_BIT }
 According to the PCI specification a BAR that is mapped into Memory Space can define memory types. More...
 

Functions

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_get_max_types (const struct doca_devinfo *devinfo, uint16_t *max_pci_types)
 Get the maximum number of PCI types that can be created by the device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_bar_size (const struct doca_devinfo *devinfo, uint8_t *log_bar_size)
 Get the minimal BAR size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_bar_size (const struct doca_devinfo *devinfo, uint8_t *log_bar_size)
 Get the maximum BAR size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_num_msix (const struct doca_devinfo *devinfo, uint16_t *num_msix)
 Get the maximal number of MSIXs that can be configured for any PCI type that was created using doca_devemu_pci_type_create() and for any PCI device that is associated with a PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_num_db (const struct doca_devinfo *devinfo, uint16_t *num_db)
 Get the maximal number of doorbells that can be configured for any PCI type that was created using doca_devemu_pci_type_create() and for any PCI device that is associated with a PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_db_size (const struct doca_devinfo *devinfo, uint8_t *log_db_size)
 Get the minimal doorbell size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_db_size (const struct doca_devinfo *devinfo, uint8_t *log_db_size)
 Get the maximum doorbell size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_db_stride_size (const struct doca_devinfo *devinfo, uint8_t *log_stride_size)
 Get the minimal stride size (in Log base 2) of a single doorbell that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_db_stride_size (const struct doca_devinfo *devinfo, uint8_t *log_stride_size)
 Get the maximal stride size (in Log base 2) of a single doorbell that can be configured for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bars (const struct doca_devinfo *devinfo, uint8_t *max_bars)
 Get the maximum number of BARs that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_regions (const struct doca_devinfo *devinfo, uint32_t *max_bar_regions)
 Get the maximum number of BAR regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_regions (const struct doca_devinfo *devinfo, uint32_t *max_bar_regions)
 Get the maximum number of BAR regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_is_identify_by_offset_supported (const struct doca_devinfo *devinfo, uint8_t *supported)
 Check if the device supports configuring doorbell regions that can identify doorbells by their offset in the BAR. If supported, one can configure a doorbell region using doca_devemu_pci_type_set_bar_db_region_by_offset_conf(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_is_identify_by_data_supported (const struct doca_devinfo *devinfo, uint8_t *supported)
 Check if the device supports configuring doorbell regions that can identify doorbells by their data. If supported, one can configure a doorbell region using doca_devemu_pci_type_set_bar_db_region_by_data_conf(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_region_block_size (const struct doca_devinfo *devinfo, uint32_t *block_size)
 Get the region block size of a doorbell BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per doorbell BAR region). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_max_num_region_blocks (const struct doca_devinfo *devinfo, uint32_t *max_blocks)
 Get the maximum number of region blocks of a single doorbell BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single doorbell region. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_db_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum amount of doorbell BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_db_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum number of BAR doorbell regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_start_addr_alignment (const struct doca_devinfo *devinfo, uint32_t *alignment)
 Get the doorbell BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_region_block_size (const struct doca_devinfo *devinfo, uint32_t *block_size)
 Get the region block size of a stateful BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per stateful BAR region). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_max_num_region_blocks (const struct doca_devinfo *devinfo, uint32_t *max_blocks)
 Get the maximum number of region blocks of a single stateful BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single stateful region. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_stateful_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum amount of stateful BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_stateful_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum number of BAR stateful regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_start_addr_alignment (const struct doca_devinfo *devinfo, uint32_t *alignment)
 Get the stateful BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_region_block_size (const struct doca_devinfo *devinfo, uint32_t *block_size)
 Get the region block size of a MSI-X table BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per MSI-X table BAR region). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_max_num_region_blocks (const struct doca_devinfo *devinfo, uint32_t *max_blocks)
 Get the maximum number of region blocks of a single MSI-X table BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single MSI-X table region. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_msix_table_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum amount of MSI-X table BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_msix_table_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum number of BAR MSI-X table regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_start_addr_alignment (const struct doca_devinfo *devinfo, uint32_t *alignment)
 Get the MSI-X table BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_region_block_size (const struct doca_devinfo *devinfo, uint32_t *block_size)
 Get the region block size of a MSI-X PBA BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per MSI-X PBA BAR region). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_max_num_region_blocks (const struct doca_devinfo *devinfo, uint32_t *max_blocks)
 Get the maximum number of region blocks of a single MSI-X PBA BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single MSI-X PBA region. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_msix_pba_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum amount of MSI-X PBA BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_msix_pba_regions (const struct doca_devinfo *devinfo, uint32_t *max_regions)
 Get the maximum number of BAR MSI-X PBA regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_start_addr_alignment (const struct doca_devinfo *devinfo, uint32_t *alignment)
 Get the MSI-X PBA BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_bar_mem_type_supported (const struct doca_devinfo *devinfo, enum doca_devemu_pci_bar_mem_type memory_type, uint8_t *supported)
 Get the memory BAR types capability of the device. If supported, A BAR with that memory type can be configured using doca_devemu_pci_type_set_memory_bar_conf(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_create (const char *name, struct doca_devemu_pci_type **pci_type)
 Create a stopped DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_destroy (struct doca_devemu_pci_type *pci_type)
 Destroy a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_start (struct doca_devemu_pci_type *pci_type)
 Start a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_stop (struct doca_devemu_pci_type *pci_type)
 Stop a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_is_started (const struct doca_devemu_pci_type *pci_type, uint8_t *started)
 Check whether the DOCA devemu PCI tpye is started. More...
 
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. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_dev (const struct doca_devemu_pci_type *pci_type, struct doca_dev **dev)
 Get the DOCA device associated with the DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_dev (struct doca_devemu_pci_type *pci_type, struct doca_dev *dev)
 Set the DOCA device for a specific DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_hotplug_supported (const struct doca_devinfo *devinfo, const struct doca_devemu_pci_type *pci_type, uint8_t *supported)
 Get the hotplug capability of the device for a given DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_mgmt_supported (const struct doca_devinfo *devinfo, const struct doca_devemu_pci_type *pci_type, uint8_t *supported)
 Get the management capability of the device for a given DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_create_rep (const struct doca_devemu_pci_type *pci_type, struct doca_dev_rep **dev_rep)
 Create a new representor device for a given DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_destroy_rep (struct doca_dev_rep *rep_dev)
 Destroy a representor device created by doca_devemu_pci_dev_create_rep(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_name (const struct doca_devemu_pci_type *pci_type, char(*name)[DOCA_DEVEMU_PCI_TYPE_NAME_LEN])
 Get the name of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_device_id (const struct doca_devemu_pci_type *pci_type, uint16_t *device_id)
 Get the PCI Device ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_device_id (struct doca_devemu_pci_type *pci_type, uint16_t device_id)
 Set the PCI Device ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_vendor_id (const struct doca_devemu_pci_type *pci_type, uint16_t *vendor_id)
 Get the PCI Vendor ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_vendor_id (struct doca_devemu_pci_type *pci_type, uint16_t vendor_id)
 Set the PCI Vendor ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_subsystem_id (const struct doca_devemu_pci_type *pci_type, uint16_t *subsystem_id)
 Get the PCI Subsystem ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_subsystem_id (struct doca_devemu_pci_type *pci_type, uint16_t subsystem_id)
 Set the PCI Subsystem ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_subsystem_vendor_id (const struct doca_devemu_pci_type *pci_type, uint16_t *subsystem_vid)
 Get the PCI Subsystem Vendor ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_subsystem_vendor_id (struct doca_devemu_pci_type *pci_type, uint16_t subsystem_vid)
 Set the PCI Subsystem Vendor ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_revision_id (const struct doca_devemu_pci_type *pci_type, uint8_t *revision_id)
 Get the PCI Revision ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_revision_id (struct doca_devemu_pci_type *pci_type, uint8_t revision_id)
 Set the PCI Revision ID of a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_class_code (const struct doca_devemu_pci_type *pci_type, uint32_t *class_code)
 Get the PCI Class Code of a DOCA devemu PCI type to identify generic operation. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_class_code (struct doca_devemu_pci_type *pci_type, uint32_t class_code)
 Set the PCI Class Code of a DOCA devemu PCI type to identify generic operation. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_num_msix (const struct doca_devemu_pci_type *pci_type, uint16_t *num_msix)
 Get the size of the MSI-X Table from MSI-X Capability Registers (1 based) of a DOCA devemu PCI type. This value will be used as the default num_msix value for associated DOCA devemu pci devices, unless configured otherwise. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_num_msix (struct doca_devemu_pci_type *pci_type, uint16_t num_msix)
 Set the size of the MSI-X Table from MSI-X Capability Registers (1 based) of a DOCA devemu PCI type. Must conform with doca_devemu_pci_cap_type_get_max_num_msix(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_num_db (const struct doca_devemu_pci_type *pci_type, uint16_t *num_db)
 Get the number of doorbells assigned to a pci type. This value will be used as the default num_db value for associated DOCA devemu pci devices, unless configured otherwise. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_num_db (struct doca_devemu_pci_type *pci_type, uint16_t num_db)
 Set the number of doorbells of a PCI type. Must conform with doca_devemu_pci_cap_type_get_max_num_db(). More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_memory_bar_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint8_t log_sz, enum doca_devemu_pci_bar_mem_type memory_type, uint8_t prefetchable)
 Set a memory BAR layout configuration for DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_io_bar_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint8_t log_sz)
 Set an IO BAR layout configuration for DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_db_region_by_offset_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, uint64_t size, uint8_t log_db_size, uint8_t log_stride_size)
 Set a doorbell BAR region configuration for a BAR layout in a DOCA devemu PCI type. The doorbells that will be associated with this doorbell BAR region will be identified according to their offset within the BAR. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_db_region_by_data_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, uint64_t size, uint8_t log_db_size, uint16_t db_id_msbyte, uint16_t db_id_lsbyte)
 Set a doorbell BAR region configuration for a BAR layout in a DOCA devemu PCI type. The doorbells that will be associated with this doorbell BAR region will be identified according to the data written to the doorbell. The doorbell identifier will be deduced from the written doorbell data by the db_id_lsbyte and db_id_msbyte settings. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_msix_table_region_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, uint64_t size)
 Set a MSI-X table BAR region configuration for a BAR layout in a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_msix_pba_region_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, uint64_t size)
 Set a MSI-X PBA BAR region configuration for a BAR layout in a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_stateful_region_conf (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, uint64_t size)
 Set a stateful BAR region configuration for a BAR layout in a DOCA devemu PCI type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_modify_bar_stateful_region_default_values (struct doca_devemu_pci_type *pci_type, uint8_t id, uint64_t start_addr, void *default_values, uint64_t size)
 Modify default registers values for a configured stateful region in a DOCA devemu PCI type. More...
 

Detailed Description

DOCA PCI type for emulated pci devices

Macro Definition Documentation

◆ DOCA_DEVEMU_PCI_TYPE_NAME_LEN

#define DOCA_DEVEMU_PCI_TYPE_NAME_LEN   32

Maximal length for the NULL terminated string that describe the name of the emulated PCI device type.

Definition at line 53 of file doca_devemu_pci_type.h.

Enumeration Type Documentation

◆ doca_devemu_pci_bar_mem_type

According to the PCI specification a BAR that is mapped into Memory Space can define memory types.

Enumerator
DOCA_DEVEMU_PCI_BAR_MEM_TYPE_32_BIT 

Base register is 32 bits wide and can be mapped anywhere in the 32 address bit Memory Space. Base register support memory space below 1 MB

DOCA_DEVEMU_PCI_BAR_MEM_TYPE_1_MB 

Base register is 64 bits wide and can be mapped anywhere in the 64 address bit Memory Space.

DOCA_DEVEMU_PCI_BAR_MEM_TYPE_64_BIT 

Definition at line 664 of file doca_devemu_pci_type.h.

Function Documentation

◆ doca_devemu_pci_cap_bar_db_region_get_max_num_region_blocks()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_max_num_region_blocks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_blocks 
)

Get the maximum number of region blocks of a single doorbell BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single doorbell region.

Parameters
[in]devinfoThe device to query.
[out]max_blocksMaximal number of region blocks for a single doorbell BAR region that will be configured using doca_devemu_pci_type_bar_db_region_<*>_conf_set(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_db_region_get_region_block_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_region_block_size ( const struct doca_devinfo *  devinfo,
uint32_t *  block_size 
)

Get the region block size of a doorbell BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per doorbell BAR region).

Parameters
[in]devinfoThe device to query.
[out]block_sizeRegion block size, in bytes, of a doorbell BAR region that will be configured using doca_devemu_pci_type_bar_db_region_<*>_conf_set(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_db_region_get_start_addr_alignment()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_get_start_addr_alignment ( const struct doca_devinfo *  devinfo,
uint32_t *  alignment 
)

Get the doorbell BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]alignmentThe start address alignment, in bytes, of doorbell BAR regions that can be configured using doca_devemu_pci_type_bar_db_region_<*>_conf_set(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_db_region_is_identify_by_data_supported()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_is_identify_by_data_supported ( const struct doca_devinfo *  devinfo,
uint8_t *  supported 
)

Check if the device supports configuring doorbell regions that can identify doorbells by their data. If supported, one can configure a doorbell region using doca_devemu_pci_type_set_bar_db_region_by_data_conf().

Parameters
[in]devinfoThe device to query.
[out]supported1 if the doorbell region by data supported, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_db_region_is_identify_by_offset_supported()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_db_region_is_identify_by_offset_supported ( const struct doca_devinfo *  devinfo,
uint8_t *  supported 
)

Check if the device supports configuring doorbell regions that can identify doorbells by their offset in the BAR. If supported, one can configure a doorbell region using doca_devemu_pci_type_set_bar_db_region_by_offset_conf().

Parameters
[in]devinfoThe device to query.
[out]supported1 if the doorbell region by offset supported, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_get_max_bar_db_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_db_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum number of BAR doorbell regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR.

Parameters
[in]devinfoThe device to query.
[out]max_regionsNumber of BAR doorbell regions that can be configured per BAR, for any pci type, using doca_devemu_pci_type_bar_db_region_<*>_conf_set().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_get_max_bar_msix_pba_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_msix_pba_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum number of BAR MSI-X PBA regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR.

Parameters
[in]devinfoThe device to query.
[out]max_regionsNumber of BAR MSI-X PBA regions that can be configured per BAR, for any pci type, using doca_devemu_pci_type_set_bar_msix_pba_region_conf().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_get_max_bar_msix_table_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_msix_table_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum number of BAR MSI-X table regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR.

Parameters
[in]devinfoThe device to query.
[out]max_regionsNumber of BAR MSI-X table regions that can be configured per BAR, for any pci type, using doca_devemu_pci_type_set_bar_msix_table_region_conf().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_get_max_bar_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_bar_regions 
)

Get the maximum number of BAR regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR.

Parameters
[in]devinfoThe device to query.
[out]max_bar_regionsNumber of BAR regions that can be configured per BAR, for any pci type, using doca_devemu_pci_type_bar_*_region_conf_set().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_get_max_bar_stateful_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_get_max_bar_stateful_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum number of BAR stateful regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create(), per BAR.

Parameters
[in]devinfoThe device to query.
[out]max_regionsNumber of BAR stateful regions that can be configured per BAR, for any pci type, using doca_devemu_pci_type_set_bar_stateful_region_conf().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_msix_pba_region_get_max_num_region_blocks()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_max_num_region_blocks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_blocks 
)

Get the maximum number of region blocks of a single MSI-X PBA BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single MSI-X PBA region.

Parameters
[in]devinfoThe device to query.
[out]max_blocksMaximal number of region blocks for a single MSI-X PBA BAR region that will be configured using doca_devemu_pci_type_set_bar_msix_pba_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_msix_pba_region_get_region_block_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_region_block_size ( const struct doca_devinfo *  devinfo,
uint32_t *  block_size 
)

Get the region block size of a MSI-X PBA BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per MSI-X PBA BAR region).

Parameters
[in]devinfoThe device to query.
[out]block_sizeRegion block size, in bytes, of a MSI-X PBA BAR region that will be configured using doca_devemu_pci_type_set_bar_msix_pba_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_srror_t.

◆ doca_devemu_pci_cap_bar_msix_pba_region_get_start_addr_alignment()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_pba_region_get_start_addr_alignment ( const struct doca_devinfo *  devinfo,
uint32_t *  alignment 
)

Get the MSI-X PBA BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]alignmentThe start address alignment, in bytes, of MSI-X PBA BAR regions that can be configured using doca_devemu_pci_type_set_bar_msix_pba_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_msix_table_region_get_max_num_region_blocks()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_max_num_region_blocks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_blocks 
)

Get the maximum number of region blocks of a single MSI-X table BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single MSI-X table region.

Parameters
[in]devinfoThe device to query.
[out]max_blocksMaximal number of region blocks for a single MSI-X table BAR region that will be configured using doca_devemu_pci_type_set_bar_msix_table_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_msix_table_region_get_region_block_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_region_block_size ( const struct doca_devinfo *  devinfo,
uint32_t *  block_size 
)

Get the region block size of a MSI-X table BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per MSI-X table BAR region).

Parameters
[in]devinfoThe device to query.
[out]block_sizeRegion block size, in bytes, of a MSI-X table BAR region that will be configured using doca_devemu_pci_type_set_bar_msix_table_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_srror_t.

◆ doca_devemu_pci_cap_bar_msix_table_region_get_start_addr_alignment()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_msix_table_region_get_start_addr_alignment ( const struct doca_devinfo *  devinfo,
uint32_t *  alignment 
)

Get the MSI-X table BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]alignmentThe start address alignment, in bytes, of MSI-X table BAR regions that can be configured using doca_devemu_pci_type_set_bar_msix_table_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_stateful_region_get_max_num_region_blocks()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_max_num_region_blocks ( const struct doca_devinfo *  devinfo,
uint32_t *  max_blocks 
)

Get the maximum number of region blocks of a single stateful BAR region that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The maximal number of region blocks together with the region block size defines the maximal size of a single stateful region.

Parameters
[in]devinfoThe device to query.
[out]max_blocksMaximal number of region blocks for a single stateful BAR region that will be configured using doca_devemu_pci_type_set_bar_stateful_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_stateful_region_get_region_block_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_region_block_size ( const struct doca_devinfo *  devinfo,
uint32_t *  block_size 
)

Get the region block size of a stateful BAR region that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it. The region block size is the smallest allocation data unit for a BAR region. For example, if the region block size is 64B then the bar region size can be 64B/128B/192B/../N*64B (N = max num region blocks per stateful BAR region).

Parameters
[in]devinfoThe device to query.
[out]block_sizeRegion block size, in bytes, of a stateful BAR region that will be configured using doca_devemu_pci_type_set_bar_stateful_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_bar_stateful_region_get_start_addr_alignment()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_bar_stateful_region_get_start_addr_alignment ( const struct doca_devinfo *  devinfo,
uint32_t *  alignment 
)

Get the stateful BAR region start address alignment that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]alignmentThe start address alignment, in bytes, of stateful BAR regions that can be configured using doca_devemu_pci_type_set_bar_stateful_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_get_max_types()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_get_max_types ( const struct doca_devinfo *  devinfo,
uint16_t *  max_pci_types 
)

Get the maximum number of PCI types that can be created by the device.

Parameters
[in]devinfoThe device to query.
[out]max_pci_typesNumber of PCI types that can be created using doca_devemu_pci_type_create().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_max_bar_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_bar_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_bar_size 
)

Get the maximum BAR size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_bar_sizeThe maximal BAR size, given in bytes, of single BAR in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_max_db_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_db_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_db_size 
)

Get the maximum doorbell size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_db_sizeThe maximal doorbell size, given in bytes, of single doorbell in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_max_db_stride_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_max_db_stride_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_stride_size 
)

Get the maximal stride size (in Log base 2) of a single doorbell that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_stride_sizeThe maximal single doorbell stride size, given in bytes, of single doorbell in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_min_bar_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_bar_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_bar_size 
)

Get the minimal BAR size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_bar_sizeThe minimal BAR size, given in bytes, of single BAR in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_min_db_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_db_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_db_size 
)

Get the minimal doorbell size (in Log base 2) that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_db_sizeThe minimal doorbell size, given in bytes, of single doorbell in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_log_min_db_stride_size()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_log_min_db_stride_size ( const struct doca_devinfo *  devinfo,
uint8_t *  log_stride_size 
)

Get the minimal stride size (in Log base 2) of a single doorbell that can be configured for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]log_stride_sizeThe minimal single doorbell stride size, given in bytes, of single doorbell in Log (base 2) units.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bar_db_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_db_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum amount of doorbell BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]max_regionsMaximal number of doorbell BAR regions that can be configured using doca_devemu_pci_type_bar_db_region_<*>_conf_set(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bar_msix_pba_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_msix_pba_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum amount of MSI-X PBA BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]max_regionsMaximal number of MSI-X PBA BAR regions that can be configured using doca_devemu_pci_type_set_bar_msix_pba_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bar_msix_table_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_msix_table_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum amount of MSI-X table BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]max_regionsMaximal number of MSI-X table BAR regions that can be configured using doca_devemu_pci_type_set_bar_msix_table_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bar_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_bar_regions 
)

Get the maximum number of BAR regions that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]max_bar_regionsNumber of BAR regions that can be configured, for any pci type, using doca_devemu_pci_type_bar_*_region_conf_set().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bar_stateful_regions()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bar_stateful_regions ( const struct doca_devinfo *  devinfo,
uint32_t *  max_regions 
)

Get the maximum amount of stateful BAR regions that can be configured for any PCI type that was created using doca_devemu_pci_type_create() or will be created by it.

Parameters
[in]devinfoThe device to query.
[out]max_regionsMaximal number of stateful BAR regions that can be configured using doca_devemu_pci_type_set_bar_stateful_region_conf(), for any pci type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_bars()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_bars ( const struct doca_devinfo *  devinfo,
uint8_t *  max_bars 
)

Get the maximum number of BARs that can be configured to an emulated PCI device, for any PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]max_barsNumber of BARs that can be configured for any pci type using doca_devemu_pci_type_*_bar_conf_set().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_num_db()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_num_db ( const struct doca_devinfo *  devinfo,
uint16_t *  num_db 
)

Get the maximal number of doorbells that can be configured for any PCI type that was created using doca_devemu_pci_type_create() and for any PCI device that is associated with a PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]num_dbThe maximal number of doorbells.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_get_max_num_msix()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_get_max_num_msix ( const struct doca_devinfo *  devinfo,
uint16_t *  num_msix 
)

Get the maximal number of MSIXs that can be configured for any PCI type that was created using doca_devemu_pci_type_create() and for any PCI device that is associated with a PCI type that was created using doca_devemu_pci_type_create().

Parameters
[in]devinfoThe device to query.
[out]num_msixThe maximal number of MSIXs.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_cap_type_is_bar_mem_type_supported()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_bar_mem_type_supported ( const struct doca_devinfo *  devinfo,
enum doca_devemu_pci_bar_mem_type  memory_type,
uint8_t *  supported 
)

Get the memory BAR types capability of the device. If supported, A BAR with that memory type can be configured using doca_devemu_pci_type_set_memory_bar_conf().

Parameters
[in]devinfoThe device to query.
[in]memory_typeThe BAR memory type to query.
[out]supported1 if the BAR memory type is supported by the device, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'devinfo' or 'supported' are NULL

◆ doca_devemu_pci_cap_type_is_hotplug_supported()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_hotplug_supported ( const struct doca_devinfo *  devinfo,
const struct doca_devemu_pci_type *  pci_type,
uint8_t *  supported 
)

Get the hotplug capability of the device for a given DOCA devemu PCI type.

Get uint8_t value defining if the device can be used to hotplug devices for a specific PCI type. The hotplug capability of a device implies its management capability.

Parameters
[in]devinfoThe device to query.
[in]pci_typeThe DOCA devemu PCI type to query.
[out]supported1 if the hotplug capability is supported for this PCI type, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'devinfo', 'pci_type' or 'supported' are NULL or devinfo doesn't match associated doca_dev, in case doca_dev already was assigned to the pci_type
  • DOCA_ERROR_DRIVER - internal doca driver error

◆ doca_devemu_pci_cap_type_is_mgmt_supported()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_type_is_mgmt_supported ( const struct doca_devinfo *  devinfo,
const struct doca_devemu_pci_type *  pci_type,
uint8_t *  supported 
)

Get the management capability of the device for a given DOCA devemu PCI type.

Get uint8_t value defining if the device can be used to manage devices for a specific PCI type. The management capability of a device doesn't imply its hotplug capability.

Parameters
[in]devinfoThe device to query.
[in]pci_typeThe DOCA devemu PCI type to query.
[out]supported1 if the management capability is supported for this PCI type, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'devinfo', 'pci_type' or 'supported' are NULL or devinfo doesn't match associated doca_dev, in case doca_dev already was assigned to the pci_type
  • DOCA_ERROR_DRIVER - internal doca driver error

◆ doca_devemu_pci_dev_create_rep()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_create_rep ( const struct doca_devemu_pci_type *  pci_type,
struct doca_dev_rep **  dev_rep 
)

Create a new representor device for a given DOCA devemu PCI type.

Upon success, the created representor device will not be visible to the host. The representor device will be discoverable using the discovery mechanism for representors and will function as a hotplug device, which can be confirmed using doca_devinfo_rep_get_is_hotplug(). Additionally upon success, the representor device's hotplug state will be DOCA_DEVEMU_PCI_HP_STATE_POWER_OFF. To verify the hotplug state of the representor device, use doca_devemu_pci_rep_get_hotplug_state().

Parameters
[in]pci_typeThe DOCA devemu PCI type. Must be started.
[out]dev_repInitialized representor DOCA device instance on success. Valid on success only.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'dev_rep' are NULL
  • DOCA_ERROR_BAD_STATE - type is not started
  • DOCA_ERROR_DRIVER - internal doca driver error
Note
PCI type must be started.

◆ doca_devemu_pci_dev_destroy_rep()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_destroy_rep ( struct doca_dev_rep *  rep_dev)

Destroy a representor device created by doca_devemu_pci_dev_create_rep().

Upon success, the destroyed representor device will not be visible to the host. The representor device will not be discoverable using the discovery mechanism for representors. The representor device should not be associated with any existing pci_dev. Additionally, the representor device's hotplug state should be DOCA_DEVEMU_PCI_HP_STATE_POWER_OFF. To verify the hotplug state of the representor device, use doca_devemu_pci_rep_get_hotplug_state().

Parameters
[in]rep_devPreviously initialized representor DOCA device instance.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'rep_dev' is NULL or corrupted
  • DOCA_ERROR_NOT_PERMITTED - representor was not created using doca_devemu_pci_dev_create_rep() or it is associated with some pci_dev
  • DOCA_ERROR_DRIVER - internal doca driver error
  • DOCA_ERROR_BAD_STATE - representor device hotplug state is not DOCA_DEVEMU_PCI_HP_STATE_POWER_OFF

◆ doca_devemu_pci_type_create()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_create ( const char *  name,
struct doca_devemu_pci_type **  pci_type 
)

Create a stopped DOCA devemu PCI type.

Parameters
[in]nameThe name to assign to the created DOCA devemu PCI type. The NULL terminated string must not exceed DOCA_DEVEMU_PCI_TYPE_NAME_LEN.
[out]pci_typeThe created and stopped DOCA devemu PCI type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'name' or 'pci_type' are NULL
  • DOCA_ERROR_NO_MEMORY - allocation failure

◆ doca_devemu_pci_type_create_rep_list()

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.

Returns all representors that are associated with the provided DOCA devemu PCI type. The provided DOCA devemu PCI type must be started. A representor can either represent an emulated PCI function that is currently attached to the host PCI subsystem or an emulated PCI function intended for hotplugging into the host PCI subsystem.

Parameters
[in]pci_typeThe DOCA devemu pci type. Must be started.
[out]dev_list_repPointer to array of pointers. Output can then be accessed as follows (*dev_list_rep)[idx].
[out]nb_devs_repNumber of available representor devices.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.
Note
Returned list must be destroyed using doca_devinfo_rep_destroy_list()

◆ doca_devemu_pci_type_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_destroy ( struct doca_devemu_pci_type *  pci_type)

Destroy a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to destroy. Must be stopped.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:

◆ doca_devemu_pci_type_get_class_code()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_class_code ( const struct doca_devemu_pci_type *  pci_type,
uint32_t *  class_code 
)

Get the PCI Class Code of a DOCA devemu PCI type to identify generic operation.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]class_codeThe PCI Class Code to identify generic operation. Only 24 LSBits are valid.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'class_code' are NULL

◆ doca_devemu_pci_type_get_dev()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_dev ( const struct doca_devemu_pci_type *  pci_type,
struct doca_dev **  dev 
)

Get the DOCA device associated with the DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]devThe associated DOCA device.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'dev' are NULL

◆ doca_devemu_pci_type_get_device_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_device_id ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  device_id 
)

Get the PCI Device ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]device_idThe PCI Device ID (DID) assigned by the vendor.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'device_id' are NULL

◆ doca_devemu_pci_type_get_name()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_name ( const struct doca_devemu_pci_type *  pci_type,
char(*)  name[DOCA_DEVEMU_PCI_TYPE_NAME_LEN] 
)

Get the name of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]nameThe name of the PCI type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'name' are NULL

◆ doca_devemu_pci_type_get_num_db()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_num_db ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  num_db 
)

Get the number of doorbells assigned to a pci type. This value will be used as the default num_db value for associated DOCA devemu pci devices, unless configured otherwise.

Parameters
[in]pci_typeThe DOCA pci type to query.
[out]num_dbThe number of doorbells assigned to the pci_type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'num_db' are NULL
  • DOCA_ERROR_NOT_PERMITTED - PCI type was not created using doca_devemu_pci_type_create()
Note
This query is applicable only for PCI types created by doca_devemu_pci_type_create()

◆ doca_devemu_pci_type_get_num_msix()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_num_msix ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  num_msix 
)

Get the size of the MSI-X Table from MSI-X Capability Registers (1 based) of a DOCA devemu PCI type. This value will be used as the default num_msix value for associated DOCA devemu pci devices, unless configured otherwise.

Parameters
[in]pci_typeThe DOCA pci type to query.
[out]num_msixThe size of the MSI-X Table from MSI-X Capability Registers (1 based).
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'num_msix' are NULL

◆ doca_devemu_pci_type_get_revision_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_revision_id ( const struct doca_devemu_pci_type *  pci_type,
uint8_t *  revision_id 
)

Get the PCI Revision ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]revision_idThe PCI Revision ID assigned by the vendor.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'revision_id' are NULL

◆ doca_devemu_pci_type_get_subsystem_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_subsystem_id ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  subsystem_id 
)

Get the PCI Subsystem ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]subsystem_idThe PCI Subsystem ID (SSID) assigned by the subsystem vendor.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'subsystem_id' are NULL

◆ doca_devemu_pci_type_get_subsystem_vendor_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_subsystem_vendor_id ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  subsystem_vid 
)

Get the PCI Subsystem Vendor ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]subsystem_vidThe PCI Subsystem Vendor ID (SVID) allocated by the PCI-SIG.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'subsystem_vid' are NULL

◆ doca_devemu_pci_type_get_vendor_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_get_vendor_id ( const struct doca_devemu_pci_type *  pci_type,
uint16_t *  vendor_id 
)

Get the PCI Vendor ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]vendor_idThe PCI Vendor ID (VID) allocated by the PCI-SIG.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'vendor_id' are NULL

◆ doca_devemu_pci_type_is_started()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_is_started ( const struct doca_devemu_pci_type *  pci_type,
uint8_t *  started 
)

Check whether the DOCA devemu PCI tpye is started.

Parameters
[in]pci_typeThe DOCA devemu PCI type to query.
[out]started1 if the DOCA devemu PCI type is started, 0 otherwise.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'started' are NULL.

◆ doca_devemu_pci_type_modify_bar_stateful_region_default_values()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_modify_bar_stateful_region_default_values ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
void *  default_values,
uint64_t  size 
)

Modify default registers values for a configured stateful region in a DOCA devemu PCI type.

This method will modify the default values for the entire stateful region registers area in a PCI type BAR (before the first modification, the initial default values of the stateful region registers are zeroed). The doca_dev_rep that will be created using doca_devemu_pci_dev_create_rep() from the associated pci_type will inherit these default values upon creation. Furthermore, each pci_dev that will be created from the associated doca_dev_rep will have a chance to update its own default values by calling doca_devemu_pci_dev_modify_bar_stateful_region_default_values() and not effecting the default values of the pci_type.

Parameters
[in]pci_typeThe DOCA devemu PCI type. Must be started and must not be associated to any pci_dev or doca_dev_rep.
[in]idThe BAR id that contains the stateful region. This value must conform with the id provided during doca_devemu_pci_type_set_bar_stateful_region_conf().
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address provided during doca_devemu_pci_type_set_bar_stateful_region_conf().
[in]default_valuesInput buffer that contain the default values data.
[in]sizeThe size of the default_values buffer in bytes. The size must not be smaller than the actual size of the stateful bar region that was configured using doca_devemu_pci_type_set_bar_stateful_region_conf(). If size is bigger than the actual size, the first relevant bytes will be used according to the actual size. The rest of the buffer will be ignored.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_bar_db_region_by_data_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_db_region_by_data_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
uint64_t  size,
uint8_t  log_db_size,
uint16_t  db_id_msbyte,
uint16_t  db_id_lsbyte 
)

Set a doorbell BAR region configuration for a BAR layout in a DOCA devemu PCI type. The doorbells that will be associated with this doorbell BAR region will be identified according to the data written to the doorbell. The doorbell identifier will be deduced from the written doorbell data by the db_id_lsbyte and db_id_msbyte settings.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id that will contain the new region.
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address alignment capability from doca_devemu_pci_cap_bar_db_region_get_start_addr_alignment().
[in]sizeThe size of the region in bytes. Must conform with doca_devemu_pci_cap_bar_db_region_get_region_block_size() and doca_devemu_pci_cap_bar_db_region_get_max_num_region_blocks().
[in]log_db_sizeThe size, given in bytes, of single doorbell in Log (base 2) units. This value must conform with doca_devemu_pci_cap_type_get_log_min_db_size() and doca_devemu_pci_cap_type_get_log_max_db_size().
[in]db_id_msbyteThe start byte of the doorbell identifier, within the doorbell data written by the driver. If the db_id_msbyte > db_id_lsbyte then the doorbell identifier will be treated as Little-Endian.
[in]db_id_lsbyteThe end byte of the doorbell identifier, within the doorbell data written by the driver. If the db_id_msbyte > db_id_lsbyte then the doorbell identifier will be treated as Little-Endian.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_bar_db_region_by_offset_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_db_region_by_offset_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
uint64_t  size,
uint8_t  log_db_size,
uint8_t  log_stride_size 
)

Set a doorbell BAR region configuration for a BAR layout in a DOCA devemu PCI type. The doorbells that will be associated with this doorbell BAR region will be identified according to their offset within the BAR.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id that will contain the new region.
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address alignment capability from doca_devemu_pci_cap_bar_db_region_get_start_addr_alignment().
[in]sizeThe size of the region in bytes. Must conform with doca_devemu_pci_cap_bar_db_region_get_region_block_size() and doca_devemu_pci_cap_bar_db_region_get_max_num_region_blocks().
[in]log_db_sizeThe size, given in bytes, of single doorbell in Log (base 2) units. This value must conform with doca_devemu_pci_cap_type_get_log_min_db_size() and doca_devemu_pci_cap_type_get_log_max_db_size().
[in]log_stride_sizeThe size, given in bytes, of a single doorbell stride in Log (base 2) units. Thie value must conform with doca_devemu_pci_cap_type_get_log_min_db_stride_size() and doca_devemu_pci_cap_type_get_log_max_db_stride_size().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_bar_msix_pba_region_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_msix_pba_region_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
uint64_t  size 
)

Set a MSI-X PBA BAR region configuration for a BAR layout in a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id that will contain the new region.
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address alignment capability from doca_devemu_pci_cap_bar_msix_pba_region_get_start_addr_alignment().
[in]sizeThe size of the region in bytes. Must correlate with the num_msix value of the pci type and conform with doca_devemu_pci_cap_bar_msix_pba_region_get_region_block_size() and doca_devemu_pci_cap_bar_msix_pba_region_get_max_num_region_blocks().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_bar_msix_table_region_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_msix_table_region_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
uint64_t  size 
)

Set a MSI-X table BAR region configuration for a BAR layout in a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id that will contain the new region.
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address alignment capability from doca_devemu_pci_cap_bar_msix_table_region_get_start_addr_alignment().
[in]sizeThe size of the region in bytes. Must correlate with the num_msix value of the pci type and conform with doca_devemu_pci_cap_bar_msix_table_region_get_region_block_size() and doca_devemu_pci_cap_bar_msix_table_region_get_max_num_region_blocks().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_bar_stateful_region_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_bar_stateful_region_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint64_t  start_addr,
uint64_t  size 
)

Set a stateful BAR region configuration for a BAR layout in a DOCA devemu PCI type.

The stateful BAR region will be used by the device to expose registers to the driver. This region will be actively maintained by the device. PCI READ transactions for this region will be automatically answered by the device. PCI WRITE transactions will be stored to this region by the device. The associated pci_dev will be notified upon any PCI WRITE transaction to this region initiated by the device driver using the doca_devemu_pci_dev_event_bar_stateful_region_driver_write event, if this event was register.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id that will contain the new region.
[in]start_addrThe start address of the region within the BAR. This value must conform with the start address alignment capability from doca_devemu_pci_cap_bar_stateful_region_get_start_addr_alignment().
[in]sizeThe size of the region in bytes. Must conform with doca_devemu_pci_cap_bar_stateful_region_get_region_block_size() and doca_devemu_pci_cap_bar_stateful_region_get_max_num_region_blocks().
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.

◆ doca_devemu_pci_type_set_class_code()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_class_code ( struct doca_devemu_pci_type *  pci_type,
uint32_t  class_code 
)

Set the PCI Class Code of a DOCA devemu PCI type to identify generic operation.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]class_codeThe PCI Class Code to identify generic operation. Only 24 LSBits are valid.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_dev()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_dev ( struct doca_devemu_pci_type *  pci_type,
struct doca_dev *  dev 
)

Set the DOCA device for a specific DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]devThe DOCA device to associate. This must remain valid for the lifetime of the DOCA devemu PCI type, or until a different device is assigned to this PCI type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' or 'dev' are NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it
  • DOCA_ERROR_NOT_PERMITTED - can't set a device for default pci types

◆ doca_devemu_pci_type_set_device_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_device_id ( struct doca_devemu_pci_type *  pci_type,
uint16_t  device_id 
)

Set the PCI Device ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]device_idThe PCI Device ID (DID) to assign.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_io_bar_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_io_bar_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint8_t  log_sz 
)

Set an IO BAR layout configuration for DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]idThe BAR id.
[in]log_szThe BAR size, in Log (base 2) units. Must be set to 0 if previous BAR requires an extension (e.g. for 64-bit BARs). Otherwise, this value must conform with doca_devemu_pci_cap_type_get_log_min_bar_size() and doca_devemu_pci_cap_type_get_log_max_bar_size() capabilities.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.
Note
This configuration is applicable only for type created by doca_devemu_pci_type_create()

◆ doca_devemu_pci_type_set_memory_bar_conf()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_memory_bar_conf ( struct doca_devemu_pci_type *  pci_type,
uint8_t  id,
uint8_t  log_sz,
enum doca_devemu_pci_bar_mem_type  memory_type,
uint8_t  prefetchable 
)

Set a memory BAR layout configuration for DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type. Must not be started.
[in]idThe BAR id.
[in]log_szThe BAR size, in Log (base 2) units. Must be set to 0 if previous BAR requires an extension (e.g. for 64-bit BARs). Otherwise, this value must conform with doca_devemu_pci_cap_type_get_log_min_bar_size() and doca_devemu_pci_cap_type_get_log_max_bar_size() capabilities.
[in]memory_typeMemory type value to expose for this BAR.
[in]prefetchablePrefetchable bit value to expose for this BAR. Set to 1 if the BAR does not contain locations with side effects on reads. Set to 0 if the BAR contains locations with read side effects or locations in which the function does not tolerate write merging.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure. see doca_error_t.
Note
This configuration is applicable only for type created by doca_devemu_pci_type_create()

◆ doca_devemu_pci_type_set_num_db()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_num_db ( struct doca_devemu_pci_type *  pci_type,
uint16_t  num_db 
)

Set the number of doorbells of a PCI type. Must conform with doca_devemu_pci_cap_type_get_max_num_db().

Parameters
[in]pci_typeThe DOCA pci type to modify. Must not be started.
[in]num_dbThe number of doorbells to assign for the pci_type.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure type after starting it
  • DOCA_ERROR_NOT_PERMITTED - PCI type was not created using doca_devemu_pci_type_create()
Note
This configuration is applicable only for PCI types created by doca_devemu_pci_type_create()

◆ doca_devemu_pci_type_set_num_msix()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_num_msix ( struct doca_devemu_pci_type *  pci_type,
uint16_t  num_msix 
)

Set the size of the MSI-X Table from MSI-X Capability Registers (1 based) of a DOCA devemu PCI type. Must conform with doca_devemu_pci_cap_type_get_max_num_msix().

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]num_msixThe size of the MSI-X Table from MSI-X Capability Registers (1 based).
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_revision_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_revision_id ( struct doca_devemu_pci_type *  pci_type,
uint8_t  revision_id 
)

Set the PCI Revision ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]revision_idThe PCI Revision ID to assign.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_subsystem_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_subsystem_id ( struct doca_devemu_pci_type *  pci_type,
uint16_t  subsystem_id 
)

Set the PCI Subsystem ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]subsystem_idThe PCI Subsystem ID (SSID) to assign.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_subsystem_vendor_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_subsystem_vendor_id ( struct doca_devemu_pci_type *  pci_type,
uint16_t  subsystem_vid 
)

Set the PCI Subsystem Vendor ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]subsystem_vidThe PCI Subsystem Vendor ID (SVID) allocated by the PCI-SIG.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_set_vendor_id()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_set_vendor_id ( struct doca_devemu_pci_type *  pci_type,
uint16_t  vendor_id 
)

Set the PCI Vendor ID of a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to modify. Must not be started.
[in]vendor_idThe PCI Vendor ID (VID) allocated by the PCI-SIG.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - can't configure PCI type after starting it

◆ doca_devemu_pci_type_start()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_start ( struct doca_devemu_pci_type *  pci_type)

Start a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to start.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL or invalid PCI parameters were previously provided
  • DOCA_ERROR_BAD_STATE - type is already started
  • DOCA_ERROR_NOT_FOUND - device was not provided - use doca_devemu_pci_type_set_dev()
  • DOCA_ERROR_NO_MEMORY - allocation failure
  • DOCA_ERROR_DRIVER - internal doca driver error
Note
This method upon success disable the ability to configure the DOCA devemu pci type.

◆ doca_devemu_pci_type_stop()

DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_type_stop ( struct doca_devemu_pci_type *  pci_type)

Stop a DOCA devemu PCI type.

Parameters
[in]pci_typeThe DOCA devemu PCI type to stop. Must not be associated to any PCI device.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - 'pci_type' is NULL
  • DOCA_ERROR_BAD_STATE - type is already stopped
  • DOCA_ERROR_DRIVER - internal doca driver error
Note
This method upon success re-enable the ability to configure the DOCA devemu PCI type.