| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |

Functions | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_cap_is_rep_port_supported (const struct doca_devinfo *devinfo, uint8_t *is_rep_port_supported) |
| Check if the device supports representors for port_probe. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_port_probe (struct doca_dev *dev, const char *devargs) |
| Attach a DPDK port specified by DOCA device. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_get_first_port_id (const struct doca_dev *dev, uint16_t *port_id) |
| Return the first DPDK port id associated to a DOCA device. Assumption is that the doca device that was probed using doca_dpdk_port_probe(). More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_port_as_dev (uint16_t port_id, struct doca_dev **dev) |
| Return the DOCA device associated with a DPDK port. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_open_dev_rep_by_port_id (uint16_t port_id, struct doca_dev *dev, struct doca_dev_rep **rep) |
| Return a new DOCA device representor associated with a DPDK port. Assumption is that the DPDK port is probed using doca_dev or doca_dpdk_port_probe(). More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_get_rep_vf_index (const struct doca_devinfo_rep *rep, uint16_t *vf_idx) |
| Return the VF index of a network VF representor. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_get_rep_sf_num (const struct doca_devinfo_rep *rep, uint16_t *sf_num) |
| Return the SF number of a network SF representor. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_create (const struct rte_mempool *mbuf_pool, struct doca_dpdk_mempool **mempool_out) |
| Create a DOCA DPDK memory pool, with ability to convert rte_mbuf to doca_buf Expected flow is as follows: Control path: // Create the memory pool based on a DPDK memory pool doca_dpdk_mempool_create() // Add 1 or more DOCA devices doca_dpdk_mempool_dev_add() // Set permission level across all devices (default=LOCAL_READ/WRITE) doca_dpdk_mempool_set_permissions() // Start the pool doca_dpdk_mempool_start() More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_destroy (struct doca_dpdk_mempool *mempool) |
| Destroy a DOCA DPDK memory pool Before destroying need to make sure that all buffers that were acquired using doca_dpdk_mempool_mbuf_to_buf() have been released This must be called before destroying the originating DPDK mempool. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_dev_add (struct doca_dpdk_mempool *mempool, struct doca_dev *dev) |
| Add a DOCA device to the mempool This allows the DOCA bufs that are retrieved from the pool to be compatible with other DOCA libraries, that use the DOCA device. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_set_permissions (struct doca_dpdk_mempool *mempool, uint32_t access_mask) |
| Set the read/write permissions of the memory for devices Default: DOCA_ACCESS_FLAG_LOCAL_READ_WRITE Setting the permission will set the access that the added devices have over the memory of the DOCA buffers. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_start (struct doca_dpdk_mempool *mempool) |
| Start the DOCA DPDK memory pool Operations that must be done before start: Adding at least 1 device - doca_dpdk_mempool_dev_add() Optionally, setting the permission level - doca_dpdk_mempool_set_permissions() Operations that are allowed after start: Acquiring a matching doca_buf from an rte_mbuf - doca_dpdk_mempool_mbuf_to_buf() Destroying the DOCA DPDK memory pool - doca_dpdk_mempool_destroy() More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_dpdk_mempool_mbuf_to_buf (struct doca_dpdk_mempool *mempool, struct doca_buf_inventory *inventory, struct rte_mbuf *mbuf, struct doca_buf **buf) |
| Acquire a doca_buf based on an rte_mbuf The acquired doca_buf attempts to be as similar as possible to the rte_mbuf Level of support: More... | |
DOCA API for integration with DPDK.
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_cap_is_rep_port_supported | ( | const struct doca_devinfo * | devinfo, |
| uint8_t * | is_rep_port_supported | ||
| ) |
Check if the device supports representors for port_probe.
| [in] | devinfo | The DOCA device information |
| [out] | is_rep_port_supported | 1 if the device supports representors for port_probe, 0 otherwise. |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_first_port_id | ( | const struct doca_dev * | dev, |
| uint16_t * | port_id | ||
| ) |
Return the first DPDK port id associated to a DOCA device. Assumption is that the doca device that was probed using doca_dpdk_port_probe().
| [in] | dev | DOCA device object |
| [out] | port_id | DPDK port id |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_rep_sf_num | ( | const struct doca_devinfo_rep * | rep, |
| uint16_t * | sf_num | ||
| ) |
Return the SF number of a network SF representor.
Can be used to build probe string for representors: E.g., representor=sf[sf_num0, sf_num1, sf_num2]
| [in] | rep | A DOCA representor representing a network SF. |
| [out] | sf_num | The returned SF number |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_rep_vf_index | ( | const struct doca_devinfo_rep * | rep, |
| uint16_t * | vf_idx | ||
| ) |
Return the VF index of a network VF representor.
Can be used to build probe string for representors: E.g., representor=vf[vf_index0, vf_index1, vf_index2]
| [in] | rep | A DOCA representor representing a network VF. |
| [out] | vf_idx | The returned VF index |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_create | ( | const struct rte_mempool * | mbuf_pool, |
| struct doca_dpdk_mempool ** | mempool_out | ||
| ) |
Create a DOCA DPDK memory pool, with ability to convert rte_mbuf to doca_buf Expected flow is as follows: Control path: // Create the memory pool based on a DPDK memory pool doca_dpdk_mempool_create() // Add 1 or more DOCA devices doca_dpdk_mempool_dev_add() // Set permission level across all devices (default=LOCAL_READ/WRITE) doca_dpdk_mempool_set_permissions() // Start the pool doca_dpdk_mempool_start()
Data path: // Convert DPDK mbuf to DOCA buf doca_dpdk_mempool_mbuf_to_buf() // Optionally release DPDK mbuf back to the DPDK pool in case it is no longer needed rte_pktmbuf_free() // Release the doca_buf once finished with it doca_buf_refcnt_rm()
| [in] | mbuf_pool | A DPDK pool of mbufs, created with rte_pktmbuf_pool_create*() |
| [out] | mempool_out | The newly created DOCA DPDK memory pool in case of success |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_destroy | ( | struct doca_dpdk_mempool * | mempool | ) |
Destroy a DOCA DPDK memory pool Before destroying need to make sure that all buffers that were acquired using doca_dpdk_mempool_mbuf_to_buf() have been released This must be called before destroying the originating DPDK mempool.
| [in] | mempool | The DOCA DPDK memory pool to destroy |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_dev_add | ( | struct doca_dpdk_mempool * | mempool, |
| struct doca_dev * | dev | ||
| ) |
Add a DOCA device to the mempool This allows the DOCA bufs that are retrieved from the pool to be compatible with other DOCA libraries, that use the DOCA device.
| [in] | mempool | The DOCA DPDK memory pool to add the device to |
| [in] | dev | A DOCA device instance |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_mbuf_to_buf | ( | struct doca_dpdk_mempool * | mempool, |
| struct doca_buf_inventory * | inventory, | ||
| struct rte_mbuf * | mbuf, | ||
| struct doca_buf ** | buf | ||
| ) |
Acquire a doca_buf based on an rte_mbuf The acquired doca_buf attempts to be as similar as possible to the rte_mbuf Level of support:
| [in] | mempool | The DOCA DPDK memory pool created using the rte_mempool that created the rte_mbuf |
| [in] | inventory | A DOCA Buffer Inventory to be used for allocating the doca_buf. Must be started and have enough space |
| [in] | mbuf | A DPDK buffer that references memory that is within the RTE mempool associated with the DOCA DPDK mempool |
| [out] | buf | A DOCA buffer that references the same memory as the provided mbuf |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_set_permissions | ( | struct doca_dpdk_mempool * | mempool, |
| uint32_t | access_mask | ||
| ) |
Set the read/write permissions of the memory for devices Default: DOCA_ACCESS_FLAG_LOCAL_READ_WRITE Setting the permission will set the access that the added devices have over the memory of the DOCA buffers.
| [in] | mempool | The DOCA DPDK memory pool |
| [in] | access_mask | The access permissions - see 'enum doca_access_flag' |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_start | ( | struct doca_dpdk_mempool * | mempool | ) |
Start the DOCA DPDK memory pool Operations that must be done before start: Adding at least 1 device - doca_dpdk_mempool_dev_add() Optionally, setting the permission level - doca_dpdk_mempool_set_permissions() Operations that are allowed after start: Acquiring a matching doca_buf from an rte_mbuf - doca_dpdk_mempool_mbuf_to_buf() Destroying the DOCA DPDK memory pool - doca_dpdk_mempool_destroy()
| [in] | mempool | The DOCA DPDK memory pool to add the device to |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_open_dev_rep_by_port_id | ( | uint16_t | port_id, |
| struct doca_dev * | dev, | ||
| struct doca_dev_rep ** | rep | ||
| ) |
Return a new DOCA device representor associated with a DPDK port. Assumption is that the DPDK port is probed using doca_dev or doca_dpdk_port_probe().
| [in] | port_id | The DPDK port identifier to get the associated DOCA device representor for. |
| [in] | dev | The DPDK DOCA device which is parent of requested representor. |
| [out] | rep | The DPDK DOCA device representor associated with the given DPDK port identifier. |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_port_as_dev | ( | uint16_t | port_id, |
| struct doca_dev ** | dev | ||
| ) |
Return the DOCA device associated with a DPDK port.
| [in] | port_id | The DPDK port identifier to get the associated DOCA device for. |
| [out] | dev | The DPDK DOCA device associated with the given DPDK port identifier. |
| DOCA_EXPERIMENTAL doca_error_t doca_dpdk_port_probe | ( | struct doca_dev * | dev, |
| const char * | devargs | ||
| ) |
Attach a DPDK port specified by DOCA device.
Thread unsafe API.
It's the user responsibility to set the DPDK EAL initialization to skip probing the PCI device associated with the given DOCA device to prevent EAL from using it.
No initialization is done for the probed PDPK port and the port is not started.
| [in] | dev | DOCA device to attach PDK port for. |
| [in] | devargs | DPDK devargs style - must NOT contains the device's PCI address ([domain:]bus:devid.func). |