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

Functions | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_create (size_t num_elements, struct doca_buf_inventory **inventory) |
| Allocates buffer inventory with default/unset attributes. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_destroy (struct doca_buf_inventory *inventory) |
| Destroy buffer inventory structure. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_start (struct doca_buf_inventory *inventory) |
| Start element retrieval from inventory. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_stop (struct doca_buf_inventory *inventory) |
| Stop element retrieval from inventory. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_buf_get_by_args (struct doca_buf_inventory *inventory, struct doca_mmap *mmap, void *addr, size_t len, void *data, size_t data_len, struct doca_buf **buf) |
Allocate single element from buffer inventory and point it to the buffer defined by addr, len, data and data_len arguments. More... | |
| static doca_error_t | doca_buf_inventory_buf_get_by_addr (struct doca_buf_inventory *inventory, struct doca_mmap *mmap, void *addr, size_t len, struct doca_buf **buf) |
Allocate single element from buffer inventory and point it to the buffer defined by addr & len arguments. More... | |
| static doca_error_t | doca_buf_inventory_buf_get_by_data (struct doca_buf_inventory *inventory, struct doca_mmap *mmap, void *data, size_t data_len, struct doca_buf **buf) |
Allocate single element from buffer inventory and point it to the buffer defined by data & data_len arguments. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_buf_dup (struct doca_buf_inventory *inventory, const struct doca_buf *src_buf, struct doca_buf **dst_buf) |
Duplicates content of the buf argument into element allocated from buffer inventory. (I.e., deep copy). More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_set_user_data (struct doca_buf_inventory *inventory, union doca_data user_data) |
| Set user_data for a DOCA Buffer Inventory. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_get_num_elements (const struct doca_buf_inventory *inventory, uint32_t *num_of_elements) |
| Read the total number of elements in a DOCA Buffer Inventory. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_get_num_free_elements (const struct doca_buf_inventory *inventory, uint32_t *num_of_free_elements) |
| Get the total number of free elements in a DOCA Buffer Inventory. More... | |
| DOCA_STABLE doca_error_t | doca_buf_inventory_get_user_data (const struct doca_buf_inventory *inventory, union doca_data *user_data) |
| Get the user_data of a DOCA Buffer Inventory. More... | |
| DOCA_EXPERIMENTAL doca_error_t | doca_buf_inventory_expand (struct doca_buf_inventory *inventory, uint32_t num_elements) |
| Expand the inventory. More... | |
The DOCA buffer inventory manages a pool of doca_buf objects. Each buffer obtained from an inventory is a descriptor that points to a memory region from a doca_mmap memory range of the user's choice.
| DOCA_STABLE doca_error_t doca_buf_inventory_buf_dup | ( | struct doca_buf_inventory * | inventory, |
| const struct doca_buf * | src_buf, | ||
| struct doca_buf ** | dst_buf | ||
| ) |
Duplicates content of the buf argument into element allocated from buffer inventory. (I.e., deep copy).
Call doca_buf_dec_refcount to return the buffer to the inventory (until ref count == 0).
| [in] | inventory | Buffer inventory structure that will hold the new doca_buf. |
| [in] | src_buf | The DOCA buf to be duplicated. |
| [out] | dst_buf | A duplicate DOCA Buf. |
|
inlinestatic |
Allocate single element from buffer inventory and point it to the buffer defined by addr & len arguments.
Call doca_buf_dec_refcount to return the buffer to the inventory (until ref count == 0).
| [in] | inventory | The DOCA Buf inventory. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | mmap | DOCA memory map structure. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | addr | The start address of the payload. |
| [in] | len | The length in bytes of the payload. |
| [out] | buf | Doca buf allocated and initialized with args. MUST NOT BE NULL. |
Definition at line 197 of file doca_buf_inventory.h.
| DOCA_STABLE doca_error_t doca_buf_inventory_buf_get_by_args | ( | struct doca_buf_inventory * | inventory, |
| struct doca_mmap * | mmap, | ||
| void * | addr, | ||
| size_t | len, | ||
| void * | data, | ||
| size_t | data_len, | ||
| struct doca_buf ** | buf | ||
| ) |
Allocate single element from buffer inventory and point it to the buffer defined by addr, len, data and data_len arguments.
Call doca_buf_dec_refcount to return the buffer to the inventory (until ref count == 0).
| [in] | inventory | The DOCA Buf inventory. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | mmap | DOCA memory map structure. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | addr | The start address of the buffer. |
| [in] | len | The length in bytes of the buffer. |
| [in] | data | The start address of the data inside the buffer. |
| [in] | data_len | The length in bytes of the data. |
| [out] | buf | Doca buf allocated and initialized with args. MUST NOT BE NULL. |
|
inlinestatic |
Allocate single element from buffer inventory and point it to the buffer defined by data & data_len arguments.
Call doca_buf_dec_refcount to return the buffer to the inventory (until ref count == 0).
| [in] | inventory | The DOCA Buf inventory. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | mmap | DOCA memory map structure. MUST NOT BE NULL AND MUST BE STARTED. |
| [in] | data | The start address of the data inside the buffer. |
| [in] | data_len | The length in bytes of the data. |
| [out] | buf | Doca buf allocated and initialized with args. MUST NOT BE NULL. |
Definition at line 228 of file doca_buf_inventory.h.
| DOCA_STABLE doca_error_t doca_buf_inventory_create | ( | size_t | num_elements, |
| struct doca_buf_inventory ** | inventory | ||
| ) |
Allocates buffer inventory with default/unset attributes.
The returned object can be manipulated with doca_buf_inventory_property_set() API. Once all required attributes are set, it should be reconfigured and adjusted to meet the setting with doca_buf_inventory_start(). See doca_buf_inventory_start for the rest of the details.
| [in] | num_elements | Initial number of elements in the inventory. |
| [out] | inventory | Buffer inventory with default/unset attributes. |
| DOCA_STABLE doca_error_t doca_buf_inventory_destroy | ( | struct doca_buf_inventory * | inventory | ) |
Destroy buffer inventory structure.
Before calling this function all allocated elements should be returned back to the inventory. Destroy implicitly stops the buf inventory. Call doca_buf_dec_refcount to return a buffer to the inventory (until ref count == 0).
| [in] | inventory | Buffer inventory structure. |
| DOCA_EXPERIMENTAL doca_error_t doca_buf_inventory_expand | ( | struct doca_buf_inventory * | inventory, |
| uint32_t | num_elements | ||
| ) |
Expand the inventory.
Add more doca_bufs to the inventory.
| [in] | inventory | Inventory to expand |
| [in] | num_elements | Number of doca_bufs to add to the inventory |
| DOCA_STABLE doca_error_t doca_buf_inventory_get_num_elements | ( | const struct doca_buf_inventory * | inventory, |
| uint32_t * | num_of_elements | ||
| ) |
Read the total number of elements in a DOCA Buffer Inventory.
The total number of elements type: uint32_t.
| [in] | inventory | The DOCA Buffer Inventory. |
| [out] | num_of_elements | The total number of elements in inventory. |
| DOCA_STABLE doca_error_t doca_buf_inventory_get_num_free_elements | ( | const struct doca_buf_inventory * | inventory, |
| uint32_t * | num_of_free_elements | ||
| ) |
Get the total number of free elements in a DOCA Buffer Inventory.
The total number of free elements type: uint32_t.
| [in] | inventory | The DOCA Buffer Inventory. |
| [out] | num_of_free_elements | The total number of free elements in inventory. |
| DOCA_STABLE doca_error_t doca_buf_inventory_get_user_data | ( | const struct doca_buf_inventory * | inventory, |
| union doca_data * | user_data | ||
| ) |
Get the user_data of a DOCA Buffer Inventory.
The user_data that was provided to the inventory upon its creation.
| [in] | inventory | The DOCA Buffer Inventory. |
| [out] | user_data | The user_data of inventory if set, otherwise 0. |
| DOCA_STABLE doca_error_t doca_buf_inventory_set_user_data | ( | struct doca_buf_inventory * | inventory, |
| union doca_data | user_data | ||
| ) |
Set user_data for a DOCA Buffer Inventory.
| [in] | inventory | The DOCA Buffer Inventory. |
| [in] | user_data | The user_data to set for inventory. |
| DOCA_STABLE doca_error_t doca_buf_inventory_start | ( | struct doca_buf_inventory * | inventory | ) |
Start element retrieval from inventory.
Un-started/stopped buffer inventory rejects all attempts to retrieve element. On first start verifies & finalizes the buffer inventory object configuration.
The following become possible only after start:
The following are NOT possible after the first time start is called:
| [in] | inventory | Buffer inventory structure. |
| DOCA_STABLE doca_error_t doca_buf_inventory_stop | ( | struct doca_buf_inventory * | inventory | ) |
Stop element retrieval from inventory.
No retrieval of elements with for stopped inventory. Stop does not have to be called before destroy (that implicitly stops the buf inventory). For details see doca_buf_inventory_start().
| [in] | inventory | Buffer inventory structure. |