The DOCA buffer array represents an array of fixed size doca_bufs (for multiple doca_dev). Can act as a free list or direct access mode.
◆ doca_dpa_dev_buf_arr_t
Type representing a doca_buf_arr handle on the DPA.
Definition at line 53 of file doca_buf_array.h.
◆ doca_buf_arr_create()
Allocates a doca_buf_arr.
- Parameters
-
| [in] | num_elem | Number of elements in the doca_buf_arr (must be > 0). |
| [out] | buf_arr | The newly created doca_buf_arr. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_NO_MEMORY - failed to allocate a doca_buf_arr.
◆ doca_buf_arr_destroy()
Destroys a doca buf array instance.
Destroy implicitly stops the buf array.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr to destroy |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
◆ doca_buf_arr_get_dpa_handle()
Retrieves the handle in the dpa memory space of a doca_buf_arr.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr |
| [out] | dpa_buf_arr | A pointer to the handle in the dpa memory space |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE - if doca_buf_arr is not started.
◆ doca_buf_arr_get_gpu_handle()
Retrieves the handle in the gpu memory space of a doca_buf_arr.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr |
| [out] | gpu_buf_arr | A pointer to the handle in the gpu memory space |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE - if doca_buf_arr is not started.
◆ doca_buf_arr_set_params()
Sets the buf array params.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr |
| [in] | mmap | The mmap managing the memory chunk. Must be populated with memory chunk. |
| [in] | elem_size | Size in bytes of a single element (must be > 0). |
| [in] | start_offset | Offset from mmap start to set doca_buf_arr. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE - if doca_buf_arr is already started
◆ doca_buf_arr_set_target_dpa()
Configures the buf array to be created on the dpa device.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr |
| [in] | dpa_handler | The dpa device handler. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE - if doca_buf_arr is already started
◆ doca_buf_arr_set_target_gpu()
Configures the buf array to be created on the gpu device.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr |
| [in] | gpu_handler | The gpu device handler. |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE - if doca_buf_arr is already started
◆ doca_buf_arr_start()
This method enables the allocation of doca_bufs.
- Note
- Before calling this function, the mmap with which the buf array was created must be started.
- Parameters
-
| [in] | buf_arr | The doca_buf_arr to start |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.
- DOCA_ERROR_BAD_STATE -
- if doca_buf_arr is already started once.
- if target device is missing
- if mmap is not started.
- DOCA_ERROR_NO_MEMORY -
- failed to allocate enough space for configuration structure
- (if set) mmap's size is too small
◆ doca_buf_arr_stop()
Stops a started doca buf array.
- Note
- Stop does not have to be called before destroy (which implicitly stops the buf array).
- Parameters
-
| [in] | buf_arr | The doca_buf_arr to stop |
- Returns
- DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
- DOCA_ERROR_INVALID_VALUE - if an invalid input had been received.