1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2017 Intel Corporation
5 #ifndef _RTE_ZUC_PMD_PRIVATE_H_
6 #define _RTE_ZUC_PMD_PRIVATE_H_
10 #define CRYPTODEV_NAME_ZUC_PMD crypto_zuc
11 /**< KASUMI PMD device name */
13 #define ZUC_LOG_ERR(fmt, args...) \
14 RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
15 RTE_STR(CRYPTODEV_NAME_ZUC_PMD), \
16 __func__, __LINE__, ## args)
18 #ifdef RTE_LIBRTE_ZUC_DEBUG
19 #define ZUC_LOG_INFO(fmt, args...) \
20 RTE_LOG(INFO, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
21 RTE_STR(CRYPTODEV_NAME_ZUC_PMD), \
22 __func__, __LINE__, ## args)
24 #define ZUC_LOG_DBG(fmt, args...) \
25 RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
26 RTE_STR(CRYPTODEV_NAME_ZUC_PMD), \
27 __func__, __LINE__, ## args)
29 #define ZUC_LOG_INFO(fmt, args...)
30 #define ZUC_LOG_DBG(fmt, args...)
33 #define ZUC_IV_KEY_LENGTH 16
34 #define ZUC_DIGEST_LENGTH 4
36 /** private data structure for each virtual ZUC device */
38 unsigned max_nb_queue_pairs;
39 /**< Max number of queue pairs supported by device */
40 unsigned max_nb_sessions;
41 /**< Max number of sessions supported by device */
44 /** ZUC buffer queue pair */
47 /**< Queue Pair Identifier */
48 char name[RTE_CRYPTODEV_NAME_MAX_LEN];
49 /**< Unique Queue Pair Name */
50 struct rte_ring *processed_ops;
51 /**< Ring for placing processed ops */
52 struct rte_mempool *sess_mp;
53 /**< Session Mempool */
54 struct rte_cryptodev_stats qp_stats;
55 /**< Queue pair statistics */
56 uint8_t temp_digest[ZUC_DIGEST_LENGTH];
57 /**< Buffer used to store the digest generated
58 * by the driver when verifying a digest provided
59 * by the user (using authentication verify operation)
61 } __rte_cache_aligned;
71 /** ZUC private session structure */
73 enum zuc_operation op;
74 enum rte_crypto_auth_operation auth_op;
75 uint8_t pKey_cipher[ZUC_IV_KEY_LENGTH];
76 uint8_t pKey_hash[ZUC_IV_KEY_LENGTH];
77 uint16_t cipher_iv_offset;
78 uint16_t auth_iv_offset;
79 } __rte_cache_aligned;
83 zuc_set_session_parameters(struct zuc_session *sess,
84 const struct rte_crypto_sym_xform *xform);
87 /** device specific operations function pointer structure */
88 extern struct rte_cryptodev_ops *rte_zuc_pmd_ops;
92 #endif /* _RTE_ZUC_PMD_PRIVATE_H_ */