New upstream version 18.02
[deb_dpdk.git] / drivers / crypto / null / null_crypto_pmd_private.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016 Intel Corporation
3  */
4
5 #ifndef _NULL_CRYPTO_PMD_PRIVATE_H_
6 #define _NULL_CRYPTO_PMD_PRIVATE_H_
7
8 #define CRYPTODEV_NAME_NULL_PMD         crypto_null
9 /**< Null crypto PMD device name */
10
11 #define NULL_CRYPTO_LOG_ERR(fmt, args...) \
12         RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n",  \
13                         RTE_STR(CRYPTODEV_NAME_NULL_PMD), \
14                         __func__, __LINE__, ## args)
15
16 #ifdef RTE_LIBRTE_NULL_CRYPTO_DEBUG
17 #define NULL_CRYPTO_LOG_INFO(fmt, args...) \
18         RTE_LOG(INFO, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
19                         RTE_STR(CRYPTODEV_NAME_NULL_PMD), \
20                         __func__, __LINE__, ## args)
21
22 #define NULL_CRYPTO_LOG_DBG(fmt, args...) \
23         RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
24                         RTE_STR(CRYPTODEV_NAME_NULL_PMD), \
25                         __func__, __LINE__, ## args)
26 #else
27 #define NULL_CRYPTO_LOG_INFO(fmt, args...)
28 #define NULL_CRYPTO_LOG_DBG(fmt, args...)
29 #endif
30
31
32 /** private data structure for each NULL crypto device */
33 struct null_crypto_private {
34         unsigned max_nb_qpairs;         /**< Max number of queue pairs */
35         unsigned max_nb_sessions;       /**< Max number of sessions */
36 };
37
38 /** NULL crypto queue pair */
39 struct null_crypto_qp {
40         uint16_t id;
41         /**< Queue Pair Identifier */
42         char name[RTE_CRYPTODEV_NAME_MAX_LEN];
43         /**< Unique Queue Pair Name */
44         struct rte_ring *processed_pkts;
45         /**< Ring for placing process packets */
46         struct rte_mempool *sess_mp;
47         /**< Session Mempool */
48         struct rte_cryptodev_stats qp_stats;
49         /**< Queue pair statistics */
50 } __rte_cache_aligned;
51
52
53 /** NULL crypto private session structure */
54 struct null_crypto_session {
55         uint32_t reserved;
56 } __rte_cache_aligned;
57
58 /** Set and validate NULL crypto session parameters */
59 extern int
60 null_crypto_set_session_parameters(struct null_crypto_session *sess,
61                 const struct rte_crypto_sym_xform *xform);
62
63 /** device specific operations function pointer structure */
64 extern struct rte_cryptodev_ops *null_crypto_pmd_ops;
65
66 #endif /* _NULL_CRYPTO_PMD_PRIVATE_H_ */