NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_devemu_pci_type.h File Reference
#include <stdint.h>
#include <sys/uio.h>
#include <doca_error.h>
#include <doca_dev.h>
#include <doca_ctx.h>
#include <doca_pe.h>
Include dependency graph for doca_devemu_pci_type.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...