26 #ifndef DOCA_DEVEMU_PCI_H_
27 #define DOCA_DEVEMU_PCI_H_
47 struct doca_devemu_pci_dev;
53 struct doca_devemu_pci_db;
64 struct doca_devemu_pci_db_completion;
75 struct doca_devemu_pci_msix;
86 struct doca_devemu_pci_resources;
108 uint32_t *max_hotplug_devices);
152 struct doca_dev_rep *dev_rep,
153 struct doca_pe *progress_engine,
154 struct doca_devemu_pci_dev **pci_dev);
289 uint16_t *subsystem_vid);
443 void *default_values,
693 struct doca_devemu_pci_dev *pci_dev,
708 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write;
719 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event,
750 struct doca_devemu_pci_dev *pci_dev,
753 uint64_t bar_region_start_addr,
767 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
780 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
793 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
838 struct doca_dpa_thread;
855 struct doca_devemu_pci_db_completion **
db_comp);
1010 struct doca_devemu_pci_db_completion *
db_comp,
1012 uint64_t bar_start_addr,
1014 uint64_t user_data_on_dpa,
1015 struct doca_devemu_pci_db **
db);
1140 uint64_t bar_start_addr,
1142 uint64_t user_data_on_dpa,
1143 struct doca_devemu_pci_msix **msix);
1222 struct doca_devemu_pci_resources **pci_resources);
1253 uint32_t *num_msix);
doca_dpa_dev_devemu_pci_db_completion_t db_comp
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_modify_bar_stateful_region_default_values(struct doca_devemu_pci_dev *pci_dev, uint8_t id, uint64_t start_addr, void *default_values, uint64_t size)
Modify default registers values for stateful region in a DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_get_curr_num_dbs(struct doca_devemu_pci_db_completion *db_comp, uint32_t *num_dbs)
Get the current number of doorbells that are associated with the completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_create(struct doca_dpa_thread *th, struct doca_devemu_pci_db_completion **db_comp)
Allocate DOCA devemu PCI device doorbell completion context on DPA. The created completion context wi...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_class_code(struct doca_devemu_pci_dev *pci_dev, uint32_t class_code)
Set the PCI Class Code of a specific DOCA devemu PCI device to identify generic operation.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_stop(struct doca_devemu_pci_db_completion *db_comp)
Stop DOCA devemu PCI device doorbell completion context.
void(* doca_devemu_pci_dev_event_bar_stateful_region_driver_write_handler_cb_t)(struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event, union doca_data user_data)
Function to be executed on PCI write transactions to BAR stateful region.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_revision_id(struct doca_devemu_pci_dev *pci_dev, uint8_t revision_id)
Set the PCI Revision ID of a specific DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_subsystem_vendor_id(struct doca_devemu_pci_dev *pci_dev, uint16_t subsystem_vid)
Set the PCI Subsystem Vendor ID of a specific DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_event_flr_register(struct doca_devemu_pci_dev *pci_dev, doca_devemu_pci_dev_event_flr_handler_cb_t handler, union doca_data user_data)
Register to PCI FLR (Function Level Reset) event.
void(* doca_devemu_pci_dev_event_hotplug_state_change_handler_cb_t)(struct doca_devemu_pci_dev *pci_dev, union doca_data user_data)
Function to be executed on hotplug state change event occurrence.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_get_dpa_handle(struct doca_devemu_pci_db *db, doca_dpa_dev_devemu_pci_db_t *db_handle)
Get the DPA handle for the DOCA devemu PCI device doorbell.
DOCA_EXPERIMENTAL uint8_t doca_devemu_pci_dev_event_bar_stateful_region_driver_write_get_bar_id(struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event)
Get the BAR id from BAR stateful region driver write event.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_hotplug(struct doca_devemu_pci_dev *pci_dev)
Issue hotplug procedure of the DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_vendor_id(struct doca_devemu_pci_dev *pci_dev, uint16_t vendor_id)
Set the PCI Vendor ID of a specific DOCA devemu PCI device.
uint64_t doca_dpa_dev_devemu_pci_db_completion_t
DPA handle for emulated PCI device doorbell completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_is_mmap_add_dev_supported(const struct doca_devinfo *devinfo, uint8_t *supported)
Check if adding the device to a DOCA mmap associated with a DOCA devemu PCI device is supported.
void(* doca_devemu_pci_dev_event_flr_handler_cb_t)(struct doca_devemu_pci_dev *pci_dev, union doca_data user_data)
Function to be executed on PCI FLR (Function Level Reset). The event handler will enable users to qui...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_class_code(const struct doca_devemu_pci_dev *pci_dev, uint32_t *class_code)
Get the PCI Class Code configured to DOCA devemu PCI device to identify generic operation.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_rep_get_hotplug_state(struct doca_dev_rep *rep_dev, enum doca_devemu_pci_hotplug_state *state)
Get the hotplug state of a DOCA representor device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_revision_id(const struct doca_devemu_pci_dev *pci_dev, uint8_t *revision_id)
Get the PCI Revision ID configured to DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_destroy(struct doca_devemu_pci_dev *pci_dev)
Free a DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_device_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *device_id)
Get the PCI Device ID configured to DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_subsystem_id(struct doca_devemu_pci_dev *pci_dev, uint16_t subsystem_id)
Set the PCI Subsystem ID of a specific DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_hotplug_state(struct doca_devemu_pci_dev *pci_dev, enum doca_devemu_pci_hotplug_state *state)
Get the hotplug state of the DOCA devemu PCI device.
DOCA_EXPERIMENTAL struct doca_devemu_pci_dev * doca_devemu_pci_dev_event_bar_stateful_region_driver_write_get_pci_dev(struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event)
Get DOCA devemu PCI device from BAR stateful region driver write event.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_destroy(struct doca_devemu_pci_db *db)
Destroy the DOCA devemu PCI device doorbell.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_num_msix(struct doca_devemu_pci_dev *pci_dev, uint16_t num_msix)
Set the number of MSI-X vectors of a specific DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_msix_create_on_dpa(struct doca_devemu_pci_dev *pci_dev, uint8_t bar_id, uint64_t bar_start_addr, uint16_t msix_idx, uint64_t user_data_on_dpa, struct doca_devemu_pci_msix **msix)
Allocate DOCA devemu PCI device MSI-X context on DPA.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_cap_get_max_hotplug_devices(const struct doca_devinfo *devinfo, uint32_t *max_hotplug_devices)
Get the maximum number of PCI devices, across all PCI types, that can be hot-plugged by the device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_subsystem_vendor_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *subsystem_vid)
Get the PCI Subsystem Vendor ID configured to DOCA devemu PCI device.
uint64_t doca_dpa_dev_devemu_pci_db_t
DPA handle for emulated PCI device doorbell.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_create(struct doca_devemu_pci_type *pci_type, struct doca_dev_rep *dev_rep, struct doca_pe *progress_engine, struct doca_devemu_pci_dev **pci_dev)
Allocate DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_query_bar_stateful_region_values(struct doca_devemu_pci_dev *pci_dev, uint8_t id, uint64_t offset, void *out_values, uint64_t size)
Query registers values of the stateful region in a DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_msix_get_dpa_handle(struct doca_devemu_pci_msix *msix, doca_dpa_dev_devemu_pci_msix_t *msix_handle)
Get the DPA handle for the DOCA devemu PCI device MSI-X.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_release_resources(struct doca_devemu_pci_resources *pci_resources)
Release the DOCA devemu PCI resources structure.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_resources_get_num_msix(const struct doca_devemu_pci_resources *pci_resources, uint32_t *num_msix)
Retrieve the number of MSI-X vectors from a PCI resources structure.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_msix_destroy(struct doca_devemu_pci_msix *msix)
Destroy the DOCA devemu PCI device MSI-X.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_query_value(struct doca_devemu_pci_db *db, uint32_t *db_value)
Query the current value of DOCA devemu PCI device doorbell.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_vendor_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *vendor_id)
Get the PCI Vendor ID configured to DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_resources_get_num_db(const struct doca_devemu_pci_resources *pci_resources, uint32_t *num_db)
Retrieve the number of Doorbells from a PCI resources structure.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_get_dpa_handle(struct doca_devemu_pci_db_completion *db_comp, doca_dpa_dev_devemu_pci_db_completion_t *db_comp_handle)
Get the DPA handle for the DOCA devemu PCI device doorbell completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_event_bar_stateful_region_driver_write_register(struct doca_devemu_pci_dev *pci_dev, doca_devemu_pci_dev_event_bar_stateful_region_driver_write_handler_cb_t handler, uint8_t bar_id, uint64_t bar_region_start_addr, union doca_data user_data)
Register to BAR stateful region driver write event.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_destroy(struct doca_devemu_pci_db_completion *db_comp)
Destroy the DOCA devemu PCI device doorbell completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_num_msix(const struct doca_devemu_pci_dev *pci_dev, uint16_t *num_msix)
Get the number of MSI-X vectors configured to DOCA devemu PCI device.
DOCA_EXPERIMENTAL uint64_t doca_devemu_pci_dev_event_bar_stateful_region_driver_write_get_bar_region_start_addr(struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event)
Get the BAR region start address that is associated with BAR stateful region driver write event.
doca_devemu_pci_hotplug_state
DOCA devemu pci hotplug state.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_start(struct doca_devemu_pci_db_completion *db_comp)
Start DOCA devemu PCI device doorbell completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_get_available_resources(const struct doca_devinfo *devinfo, struct doca_devemu_pci_resources **pci_resources)
Retrieve available PCI resources for device usage.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_stop(struct doca_devemu_pci_db *db)
Stop DOCA devemu PCI device doorbell. A stopped doorbell will not trigger completions on the associat...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_event_hotplug_state_change_register(struct doca_devemu_pci_dev *pci_dev, doca_devemu_pci_dev_event_hotplug_state_change_handler_cb_t handler, union doca_data user_data)
Register to hotplug state changes.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_set_max_num_dbs(struct doca_devemu_pci_db_completion *db_comp, uint32_t num_dbs)
Set the maximal number of doorbells that can be associated with the completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_create_on_dpa(struct doca_devemu_pci_dev *pci_dev, struct doca_devemu_pci_db_completion *db_comp, uint8_t bar_id, uint64_t bar_start_addr, uint32_t db_id, uint64_t user_data_on_dpa, struct doca_devemu_pci_db **db)
Allocate DOCA devemu PCI device doorbell on DPA. The created doorbell will be associated with a singl...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_mmap_create(struct doca_devemu_pci_dev *pci_dev, struct doca_mmap **mmap)
Allocates zero size memory map object with default/unset attributes associated with a DOCA devemu PCI...
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_start(struct doca_devemu_pci_db *db)
Start DOCA devemu PCI device doorbell. A started doorbell will be able to trigger completions on the ...
DOCA_EXPERIMENTAL struct doca_ctx * doca_devemu_pci_dev_as_ctx(struct doca_devemu_pci_dev *pci_dev)
Convert DOCA devemu PCI device instance into DOCA context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_completion_get_max_num_dbs(struct doca_devemu_pci_db_completion *db_comp, uint32_t *num_dbs)
Get the maximal number of doorbells that can be associated with the completion context.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_get_subsystem_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *subsystem_id)
Get the PCI Subsystem ID configured to DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_db_modify_value(struct doca_devemu_pci_db *db, uint32_t db_value)
Modify the current value of DOCA devemu PCI device doorbell. If the doorbell is started,...
uint64_t doca_dpa_dev_devemu_pci_msix_t
DPA handle for emulated PCI device MSI-X.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_set_device_id(struct doca_devemu_pci_dev *pci_dev, uint16_t device_id)
Set the PCI Device ID of a specific DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_hotunplug(struct doca_devemu_pci_dev *pci_dev)
Issue hot unplug procedure of the DOCA devemu PCI device.
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_is_flr(const struct doca_devemu_pci_dev *pci_dev, uint8_t *flr)
Query wheather the DOCA devemu PCI device is having FLR (Function Level Reset).
DOCA_EXPERIMENTAL doca_error_t doca_devemu_pci_dev_modify_bar_stateful_region_values(struct doca_devemu_pci_dev *pci_dev, uint8_t id, uint64_t offset, void *values, uint64_t size)
Modify registers values for stateful region in a DOCA devemu PCI device.
@ DOCA_DEVEMU_PCI_HP_STATE_POWER_OFF
@ DOCA_DEVEMU_PCI_HP_STATE_UNPLUG_IN_PROGRESS
@ DOCA_DEVEMU_PCI_HP_STATE_PLUG_IN_PROGRESS
@ DOCA_DEVEMU_PCI_HP_STATE_POWER_ON
enum doca_error doca_error_t
DOCA API return codes.
Convenience type for representing opaque data.