xref: /dpdk/drivers/common/cpt/cpt_pmd_ops_helper.h (revision 1094dd940ec0cc4e3ce2c5cd94807350855a17f9)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Cavium, Inc
3  */
4 
5 #ifndef _CPT_PMD_OPS_HELPER_H_
6 #define _CPT_PMD_OPS_HELPER_H_
7 
8 #include <rte_compat.h>
9 
10 /*
11  * This file defines the agreement between the common layer and the individual
12  * crypto drivers for OCTEON TX series. Control path in otx* directory can
13  * directly call functions declared here.
14  */
15 
16 /*
17  * Get meta length required when operating in direct mode (single buffer
18  * in-place)
19  *
20  * @return
21  *   - length
22  */
23 __rte_internal
24 int32_t
25 cpt_pmd_ops_helper_get_mlen_direct_mode(void);
26 
27 /*
28  * Get size of contiguous meta buffer to be allocated when working in scatter
29  * gather mode.
30  *
31  * @return
32  *   - length
33  */
34 __rte_internal
35 int
36 cpt_pmd_ops_helper_get_mlen_sg_mode(void);
37 
38 /*
39  * Get size of meta buffer to be allocated for asymmetric crypto operations
40  *
41  * @return
42  *  - length
43  */
44 __rte_internal
45 int
46 cpt_pmd_ops_helper_asym_get_mlen(void);
47 
48 /*
49  * Initialize ECC FMUL precomputed table
50  *
51  * @param
52  *  - pointer to fpm_table iova address
53  *
54  * @return
55  *  - 0 on success, negative on error
56  */
57 __rte_internal
58 int cpt_fpm_init(uint64_t *fpm_table_iova);
59 
60 /*
61  * Clear ECC FMUL precomputed table
62  */
63 __rte_internal
64 void cpt_fpm_clear(void);
65 
66 #endif /* _CPT_PMD_OPS_HELPER_H_ */
67