0da9b9255257b3cede8b2882e6b7221bb42c2552
[dpdk.git] / drivers / crypto / ccp / ccp_pmd_private.h
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
3  */
4
5 #ifndef _CCP_PMD_PRIVATE_H_
6 #define _CCP_PMD_PRIVATE_H_
7
8 #include <rte_cryptodev.h>
9
10 #define CRYPTODEV_NAME_CCP_PMD crypto_ccp
11
12 #define CCP_LOG_ERR(fmt, args...) \
13         RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n",  \
14                         RTE_STR(CRYPTODEV_NAME_CCP_PMD), \
15                         __func__, __LINE__, ## args)
16
17 #ifdef RTE_LIBRTE_CCP_DEBUG
18 #define CCP_LOG_INFO(fmt, args...) \
19         RTE_LOG(INFO, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
20                         RTE_STR(CRYPTODEV_NAME_CCP_PMD), \
21                         __func__, __LINE__, ## args)
22
23 #define CCP_LOG_DBG(fmt, args...) \
24         RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
25                         RTE_STR(CRYPTODEV_NAME_CCP_PMD), \
26                         __func__, __LINE__, ## args)
27 #else
28 #define CCP_LOG_INFO(fmt, args...)
29 #define CCP_LOG_DBG(fmt, args...)
30 #endif
31
32 /**< Maximum queue pairs supported by CCP PMD */
33 #define CCP_PMD_MAX_QUEUE_PAIRS 1
34 #define CCP_NB_MAX_DESCRIPTORS 1024
35 #define CCP_MAX_BURST 64
36
37 /* private data structure for each CCP crypto device */
38 struct ccp_private {
39         unsigned int max_nb_qpairs;     /**< Max number of queue pairs */
40         unsigned int max_nb_sessions;   /**< Max number of sessions */
41         uint8_t crypto_num_dev;         /**< Number of working crypto devices */
42 };
43
44 /**< device specific operations function pointer structure */
45 extern struct rte_cryptodev_ops *ccp_pmd_ops;
46
47 uint16_t
48 ccp_cpu_pmd_enqueue_burst(void *queue_pair,
49                           struct rte_crypto_op **ops,
50                           uint16_t nb_ops);
51 uint16_t
52 ccp_cpu_pmd_dequeue_burst(void *queue_pair,
53                           struct rte_crypto_op **ops,
54                           uint16_t nb_ops);
55
56 #endif /* _CCP_PMD_PRIVATE_H_ */