|
CNDP 22.08.0
|
Go to the source code of this file.
Data Structures | |
| struct | dsa_stats |
Macros | |
| #define | DSA_OP_SUCCESS 0x0 |
| #define | DSA_OP_SKIPPED 0x1 |
| #define | DSA_OP_ADDRESS_ERR 0x03 |
| #define | DSA_OP_INVALID_LEN 0x13 |
| #define | DSA_OP_OVERLAPPING_BUFS 0x16 |
Functions | |
| CNDP_API int16_t | dsa_open (const char *name) |
| CNDP_API int | dsa_close (uint16_t dev) |
| CNDP_API int | dsa_get_stats (uint16_t dev, struct dsa_stats *stats) |
| CNDP_API uint16_t | dsa_burst_capacity (uint16_t dev) |
| CNDP_API int | dsa_enqueue_fill (uint16_t dev, uint64_t pattern, phys_addr_t dst, uint32_t length, uintptr_t dst_hdl) |
| CNDP_API int | dsa_enqueue_copy (uint16_t dev, phys_addr_t src, phys_addr_t dst, uint32_t length, uintptr_t src_hdl, uintptr_t dst_hdl) |
| CNDP_API int | dsa_fence (uint16_t dev) |
| CNDP_API int | dsa_perform_ops (uint16_t dev) |
| CNDP_API int | dsa_completed_ops (uint16_t dev, uint8_t max_copies, uint32_t *status, uint8_t *num_unsuccessful, uintptr_t *src_hdls, uintptr_t *dst_hdls) |
Interact with Intel(R) Data Streaming Accelerator (DSA).
Definition in file cne_dsa.h.
| #define DSA_OP_SUCCESS 0x0 |
| #define DSA_OP_SKIPPED 0x1 |
| #define DSA_OP_ADDRESS_ERR 0x03 |
| #define DSA_OP_INVALID_LEN 0x13 |
| #define DSA_OP_OVERLAPPING_BUFS 0x16 |
| CNDP_API int16_t dsa_open | ( | const char * | name | ) |
Open a device
| name | the device name in "/dev/dsa" |
| CNDP_API int dsa_close | ( | uint16_t | dev | ) |
Close a device previously opened with dsa_open()
| dev | The dsa device id returned by dsa_open() |
| CNDP_API int dsa_get_stats | ( | uint16_t | dev, |
| struct dsa_stats * | stats ) |
Get device statistics
| dev | The dsa device id returned by dsa_open() |
| stats | A pointer to store statistics |
| CNDP_API uint16_t dsa_burst_capacity | ( | uint16_t | dev | ) |
Return the number of available hardware descriptors
| dev | The dsa device id returned by dsa_open() |
| CNDP_API int dsa_enqueue_fill | ( | uint16_t | dev, |
| uint64_t | pattern, | ||
| phys_addr_t | dst, | ||
| uint32_t | length, | ||
| uintptr_t | dst_hdl ) |
Enqueue a fill operation onto the device
This queues up a fill operation to be performed by hardware, but does not trigger hardware to begin that operation.
| dev | The dsa device id returned by dsa_open() |
| pattern | The pattern with which to populate the destination buffer |
| dst | The address of the destination buffer |
| length | The length of the destination buffer |
| dst_hdl | An opaque handle for the destination data, to be returned when this operation has been completed and the user polls for the completion details. |
| CNDP_API int dsa_enqueue_copy | ( | uint16_t | dev, |
| phys_addr_t | src, | ||
| phys_addr_t | dst, | ||
| uint32_t | length, | ||
| uintptr_t | src_hdl, | ||
| uintptr_t | dst_hdl ) |
Enqueue a copy operation onto the device
This queues up a copy operation to be performed by hardware, but does not trigger hardware to begin that operation.
| dev | The dsa device id returned by dsa_open() |
| src | The address of the source buffer |
| dst | The address of the destination buffer |
| length | The length of the data to copy |
| src_hdl | An opaque handle for the source data, to be returned when this operation has been completed and the user polls for the completion details. |
| dst_hdl | An opaque handle for the destination data, to be returned when this operation has been completed and the user polls for the completion details. |
| CNDP_API int dsa_fence | ( | uint16_t | dev | ) |
Add a fence to force ordering between operations
This adds a fence to a sequence of operations to enforce ordering, such that all operations enqueued before the fence must be completed before operations after the fence. NOTE: Since this fence may be added as a flag to the last operation enqueued, this API may not function correctly when called immediately after an dsa_perform_ops() call i.e. before any new operations are enqueued.
| dev | The dsa device id returned by dsa_open() |
| CNDP_API int dsa_perform_ops | ( | uint16_t | dev | ) |
Trigger hardware to begin performing enqueued operations
This API is used to write the "doorbell" to the hardware to trigger it to begin the operations previously enqueued by dsa_enqueue_*()
| dev | The dsa device id returned by dsa_open() |
| CNDP_API int dsa_completed_ops | ( | uint16_t | dev, |
| uint8_t | max_copies, | ||
| uint32_t * | status, | ||
| uint8_t * | num_unsuccessful, | ||
| uintptr_t * | src_hdls, | ||
| uintptr_t * | dst_hdls ) |
Returns details of operations that have been completed
The status of each operation is returned in the status array parameter. The function will return to the caller the user-provided "handles" for the copy operations completed by the hardware, and not already returned by a previous call to this API. If the src_hdls or dst_hdls parameters are NULL, they will be ignored, and the function returns the number of newly-completed operations. If status is also NULL, then max_copies parameter is also ignored and the function returns a count of the number of newly-completed operations.
| dev | The dsa device id returned by dsa_open() |
| max_copies | The number of entries which can fit in the status, src_hdls and dst_hdls arrays, i.e. max number of completed operations to report. |
| status | Array to hold the status of each completed operation. Array should be set to zeros on input, as the driver will only write error status values. A value of 1 implies an operation was not attempted, and any other non-zero value indicates operation failure. Parameter may be NULL if no status value checking is required. |
| num_unsuccessful | Returns the number of elements in status where the value is non-zero, i.e. the operation either failed or was not attempted due to an earlier failure. If this value is returned as zero (the expected case), the status array will not have been modified by the function and need not be checked by software |
| src_hdls | Array to hold the source handle parameters of the completed ops. Can be NULL. |
| dst_hdls | Array to hold the destination handle parameters of the completed ops. Can be NULL. |