NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_devemu_pci.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
26 #ifndef DOCA_DEVEMU_PCI_H_
27 #define DOCA_DEVEMU_PCI_H_
28 
29 #include <stdint.h>
30 #include <sys/uio.h>
31 
32 #include <doca_error.h>
33 #include <doca_dev.h>
34 #include <doca_mmap.h>
35 #include <doca_ctx.h>
36 #include <doca_pe.h>
37 #include <doca_devemu_pci_type.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
47 struct doca_devemu_pci_dev;
48 
53 struct doca_devemu_pci_db;
54 
59 
64 struct doca_devemu_pci_db_completion;
65 
70 
75 struct doca_devemu_pci_msix;
76 
81 
86 struct doca_devemu_pci_resources;
87 
88 /*********************************************************************************************************************
89  * DOCA devemu pci Device Info Properties
90  *********************************************************************************************************************/
91 
108  uint32_t *max_hotplug_devices);
109 
125 doca_error_t doca_devemu_pci_cap_is_mmap_add_dev_supported(const struct doca_devinfo *devinfo, uint8_t *supported);
126 
127 /*********************************************************************************************************************
128  * DOCA devemu PCI device API
129  *********************************************************************************************************************/
130 
151 doca_error_t doca_devemu_pci_dev_create(struct doca_devemu_pci_type *pci_type,
152  struct doca_dev_rep *dev_rep,
153  struct doca_pe *progress_engine,
154  struct doca_devemu_pci_dev **pci_dev);
155 
170 doca_error_t doca_devemu_pci_dev_destroy(struct doca_devemu_pci_dev *pci_dev);
171 
186 doca_error_t doca_devemu_pci_dev_get_device_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *device_id);
187 
204 doca_error_t doca_devemu_pci_dev_set_device_id(struct doca_devemu_pci_dev *pci_dev, uint16_t device_id);
205 
220 doca_error_t doca_devemu_pci_dev_get_vendor_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *vendor_id);
221 
238 doca_error_t doca_devemu_pci_dev_set_vendor_id(struct doca_devemu_pci_dev *pci_dev, uint16_t vendor_id);
239 
254 doca_error_t doca_devemu_pci_dev_get_subsystem_id(const struct doca_devemu_pci_dev *pci_dev, uint16_t *subsystem_id);
255 
272 doca_error_t doca_devemu_pci_dev_set_subsystem_id(struct doca_devemu_pci_dev *pci_dev, uint16_t subsystem_id);
273 
288 doca_error_t doca_devemu_pci_dev_get_subsystem_vendor_id(const struct doca_devemu_pci_dev *pci_dev,
289  uint16_t *subsystem_vid);
290 
307 doca_error_t doca_devemu_pci_dev_set_subsystem_vendor_id(struct doca_devemu_pci_dev *pci_dev, uint16_t subsystem_vid);
308 
323 doca_error_t doca_devemu_pci_dev_get_revision_id(const struct doca_devemu_pci_dev *pci_dev, uint8_t *revision_id);
324 
341 doca_error_t doca_devemu_pci_dev_set_revision_id(struct doca_devemu_pci_dev *pci_dev, uint8_t revision_id);
342 
357 doca_error_t doca_devemu_pci_dev_get_class_code(const struct doca_devemu_pci_dev *pci_dev, uint32_t *class_code);
358 
375 doca_error_t doca_devemu_pci_dev_set_class_code(struct doca_devemu_pci_dev *pci_dev, uint32_t class_code);
376 
391 doca_error_t doca_devemu_pci_dev_get_num_msix(const struct doca_devemu_pci_dev *pci_dev, uint16_t *num_msix);
392 
409 doca_error_t doca_devemu_pci_dev_set_num_msix(struct doca_devemu_pci_dev *pci_dev, uint16_t num_msix);
410 
441  uint8_t id,
442  uint64_t start_addr,
443  void *default_values,
444  uint64_t size);
445 
471  uint8_t id,
472  uint64_t offset,
473  void *values,
474  uint64_t size);
475 
496  uint8_t id,
497  uint64_t offset,
498  void *out_values,
499  uint64_t size);
500 
511 struct doca_ctx *doca_devemu_pci_dev_as_ctx(struct doca_devemu_pci_dev *pci_dev);
512 
533 doca_error_t doca_devemu_pci_dev_is_flr(const struct doca_devemu_pci_dev *pci_dev, uint8_t *flr);
534 
535 /*********************************************************************************************************************
536  * DOCA devemu PCI device hotplug API
537  *********************************************************************************************************************/
538 
575 };
576 
592 doca_error_t doca_devemu_pci_dev_get_hotplug_state(struct doca_devemu_pci_dev *pci_dev,
593  enum doca_devemu_pci_hotplug_state *state);
594 
614  enum doca_devemu_pci_hotplug_state *state);
615 
634 doca_error_t doca_devemu_pci_dev_hotplug(struct doca_devemu_pci_dev *pci_dev);
635 
655 doca_error_t doca_devemu_pci_dev_hotunplug(struct doca_devemu_pci_dev *pci_dev);
656 
657 /*********************************************************************************************************************
658  * DOCA devemu PCI device events
659  *********************************************************************************************************************/
660 
669 typedef void (*doca_devemu_pci_dev_event_hotplug_state_change_handler_cb_t)(struct doca_devemu_pci_dev *pci_dev,
670  union doca_data user_data);
671 
693  struct doca_devemu_pci_dev *pci_dev,
695  union doca_data user_data);
696 
708 struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write;
709 
719  struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event,
720  union doca_data user_data);
721 
750  struct doca_devemu_pci_dev *pci_dev,
752  uint8_t bar_id,
753  uint64_t bar_region_start_addr,
754  union doca_data user_data);
755 
767  struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
768 
780  struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
781 
793  struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event);
794 
810 typedef void (*doca_devemu_pci_dev_event_flr_handler_cb_t)(struct doca_devemu_pci_dev *pci_dev,
811  union doca_data user_data);
812 
830 doca_error_t doca_devemu_pci_dev_event_flr_register(struct doca_devemu_pci_dev *pci_dev,
832  union doca_data user_data);
833 
834 /*********************************************************************************************************************
835  * DOCA devemu pci Doorbell
836  *********************************************************************************************************************/
837 
838 struct doca_dpa_thread;
839 
855  struct doca_devemu_pci_db_completion **db_comp);
856 
870 doca_error_t doca_devemu_pci_db_completion_destroy(struct doca_devemu_pci_db_completion *db_comp);
871 
891 doca_error_t doca_devemu_pci_db_completion_start(struct doca_devemu_pci_db_completion *db_comp);
892 
914 doca_error_t doca_devemu_pci_db_completion_stop(struct doca_devemu_pci_db_completion *db_comp);
915 
931 
946  uint32_t num_dbs);
947 
962  uint32_t *num_dbs);
963 
978  uint32_t *num_dbs);
979 
1009 doca_error_t doca_devemu_pci_db_create_on_dpa(struct doca_devemu_pci_dev *pci_dev,
1010  struct doca_devemu_pci_db_completion *db_comp,
1011  uint8_t bar_id,
1012  uint64_t bar_start_addr,
1013  uint32_t db_id,
1014  uint64_t user_data_on_dpa,
1015  struct doca_devemu_pci_db **db);
1016 
1030 doca_error_t doca_devemu_pci_db_destroy(struct doca_devemu_pci_db *db);
1031 
1046 
1060 doca_error_t doca_devemu_pci_db_start(struct doca_devemu_pci_db *db);
1061 
1075 doca_error_t doca_devemu_pci_db_stop(struct doca_devemu_pci_db *db);
1076 
1092 doca_error_t doca_devemu_pci_db_modify_value(struct doca_devemu_pci_db *db, uint32_t db_value);
1093 
1107 doca_error_t doca_devemu_pci_db_query_value(struct doca_devemu_pci_db *db, uint32_t *db_value);
1108 
1109 /*********************************************************************************************************************
1110  * DOCA devemu pci MSIX
1111  *********************************************************************************************************************/
1112 
1138 doca_error_t doca_devemu_pci_msix_create_on_dpa(struct doca_devemu_pci_dev *pci_dev,
1139  uint8_t bar_id,
1140  uint64_t bar_start_addr,
1141  uint16_t msix_idx,
1142  uint64_t user_data_on_dpa,
1143  struct doca_devemu_pci_msix **msix);
1144 
1158 doca_error_t doca_devemu_pci_msix_destroy(struct doca_devemu_pci_msix *msix);
1159 
1173 doca_error_t doca_devemu_pci_msix_get_dpa_handle(struct doca_devemu_pci_msix *msix,
1174  doca_dpa_dev_devemu_pci_msix_t *msix_handle);
1175 
1176 /*********************************************************************************************************************
1177  * DOCA devemu MMAP
1178  *********************************************************************************************************************/
1179 
1197 doca_error_t doca_devemu_pci_mmap_create(struct doca_devemu_pci_dev *pci_dev, struct doca_mmap **mmap);
1198 
1199 /*********************************************************************************************************************
1200  * DOCA devemu PCI resources
1201  *********************************************************************************************************************/
1202 
1221 doca_error_t doca_devemu_pci_get_available_resources(const struct doca_devinfo *devinfo,
1222  struct doca_devemu_pci_resources **pci_resources);
1223 
1236 doca_error_t doca_devemu_pci_release_resources(struct doca_devemu_pci_resources *pci_resources);
1237 
1252 doca_error_t doca_devemu_pci_resources_get_num_msix(const struct doca_devemu_pci_resources *pci_resources,
1253  uint32_t *num_msix);
1254 
1269 doca_error_t doca_devemu_pci_resources_get_num_db(const struct doca_devemu_pci_resources *pci_resources,
1270  uint32_t *num_db);
1271 
1272 #ifdef __cplusplus
1273 }
1274 #endif
1275 
1278 #endif /* DOCA_DEVEMU_PCI_H_ */
doca_dpa_dev_devemu_pci_db_completion_t db_comp
doca_dpa_dev_mmap_t mmap
uint64_t db
uint32_t db_value
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
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.
Definition: doca_types.h:56