32 #ifndef _RTE_CRYPTODEV_H_
33 #define _RTE_CRYPTODEV_H_
52 #define CRYPTODEV_NAME_NULL_PMD ("cryptodev_null_pmd")
54 #define CRYPTODEV_NAME_AESNI_MB_PMD ("cryptodev_aesni_mb_pmd")
56 #define CRYPTODEV_NAME_AESNI_GCM_PMD ("cryptodev_aesni_gcm_pmd")
58 #define CRYPTODEV_NAME_QAT_SYM_PMD ("cryptodev_qat_sym_pmd")
60 #define CRYPTODEV_NAME_SNOW3G_PMD ("cryptodev_snow3g_pmd")
72 extern const char **rte_cyptodev_names;
76 #define CDEV_LOG_ERR(fmt, args...) \
77 RTE_LOG(ERR, CRYPTODEV, "%s() line %u: " fmt "\n", \
78 __func__, __LINE__, ## args)
80 #define CDEV_PMD_LOG_ERR(dev, fmt, args...) \
81 RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
82 dev, __func__, __LINE__, ## args)
84 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
85 #define CDEV_LOG_DEBUG(fmt, args...) \
86 RTE_LOG(DEBUG, CRYPTODEV, "%s() line %u: " fmt "\n", \
87 __func__, __LINE__, ## args) \
89 #define CDEV_PMD_TRACE(fmt, args...) \
90 RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s: " fmt "\n", \
91 dev, __func__, ## args)
94 #define CDEV_LOG_DEBUG(fmt, args...)
95 #define CDEV_PMD_TRACE(fmt, args...)
184 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
185 { RTE_CRYPTO_OP_TYPE_UNDEFINED }
196 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
198 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
200 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
202 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
204 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
206 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
208 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
210 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
246 #define RTE_CRYPTODEV_DETACHED (0)
247 #define RTE_CRYPTODEV_ATTACHED (1)
287 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS 8
288 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS 2048
294 struct rte_crypto_vdev_init_params {
295 unsigned max_nb_queue_pairs;
296 unsigned max_nb_sessions;
300 #define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG ("max_nb_queue_pairs")
301 #define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG ("max_nb_sessions")
302 #define RTE_CRYPTODEV_VDEV_SOCKET_ID ("socket_id")
304 static const char *cryptodev_vdev_valid_params[] = {
305 RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
306 RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
307 RTE_CRYPTODEV_VDEV_SOCKET_ID
310 static inline uint8_t
311 number_of_sockets(
void)
317 for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].
addr != NULL)); i++) {
329 const char *value,
void *extra_args)
331 int *i = (
int *) extra_args;
335 CDEV_LOG_ERR(
"Argument has to be positive.");
355 const char *input_args)
365 cryptodev_vdev_valid_params);
370 RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
372 ¶ms->max_nb_queue_pairs);
377 RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
379 ¶ms->max_nb_sessions);
389 if (params->socket_id >= number_of_sockets()) {
390 CDEV_LOG_ERR(
"Invalid socket id specified to create "
391 "the virtual crypto device on");
452 rte_cryptodev_socket_id(uint8_t dev_id);
675 struct rte_cryptodev_callback;
678 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
711 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
780 static inline uint16_t
823 static inline uint16_t