CNDP  22.08.0
cne_dsa.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2019-2022 Intel Corporation
3  */
4 
5 #ifndef _CNE_DSA_H_
6 #define _CNE_DSA_H_
7 
14 #include <stdint.h>
15 #include <cne_common.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /*
22  * Status codes for operations. See dsa_completed_ops(). Values >1 indicate a failure
23  * condition as reported by the device. Those error codes are from Intel(R) Data
24  * Streaming Accelerator Architecture Specification, section 5.7.
25  */
26 #define DSA_OP_SUCCESS 0x0
27 #define DSA_OP_SKIPPED 0x1
28 #define DSA_OP_ADDRESS_ERR 0x03
29 #define DSA_OP_INVALID_LEN 0x13
30 #define DSA_OP_OVERLAPPING_BUFS 0x16
33 struct dsa_stats {
34  uint64_t enqueue_failed;
35  uint64_t enqueued;
36  uint64_t started;
37  uint64_t completed;
38 };
39 
48 CNDP_API int16_t dsa_open(const char *name);
49 
58 CNDP_API int dsa_close(uint16_t dev);
59 
70 CNDP_API int dsa_get_stats(uint16_t dev, struct dsa_stats *stats);
71 
80 CNDP_API uint16_t dsa_burst_capacity(uint16_t dev);
81 
102 CNDP_API int dsa_enqueue_fill(uint16_t dev, uint64_t pattern, phys_addr_t dst, uint32_t length,
103  uintptr_t dst_hdl);
104 
128 CNDP_API int dsa_enqueue_copy(uint16_t dev, phys_addr_t src, phys_addr_t dst, uint32_t length,
129  uintptr_t src_hdl, uintptr_t dst_hdl);
130 
146 CNDP_API int dsa_fence(uint16_t dev);
147 
159 CNDP_API int dsa_perform_ops(uint16_t dev);
160 
200 CNDP_API int dsa_completed_ops(uint16_t dev, uint8_t max_copies, uint32_t *status,
201  uint8_t *num_unsuccessful, uintptr_t *src_hdls, uintptr_t *dst_hdls);
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* _CNE_DSA_H_ */
uint64_t phys_addr_t
Definition: cne_common.h:398
CNDP_API uint16_t dsa_burst_capacity(uint16_t dev)
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 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_completed_ops(uint16_t dev, uint8_t max_copies, uint32_t *status, uint8_t *num_unsuccessful, uintptr_t *src_hdls, uintptr_t *dst_hdls)
CNDP_API int dsa_fence(uint16_t dev)
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_perform_ops(uint16_t dev)
uint64_t started
Definition: cne_dsa.h:36
uint64_t enqueued
Definition: cne_dsa.h:35
uint64_t enqueue_failed
Definition: cne_dsa.h:34
uint64_t completed
Definition: cne_dsa.h:37