32 #ifndef _RTE_CRYPTODEV_H_
33 #define _RTE_CRYPTODEV_H_
53 #define CRYPTODEV_NAME_NULL_PMD crypto_null
55 #define CRYPTODEV_NAME_AESNI_MB_PMD crypto_aesni_mb
57 #define CRYPTODEV_NAME_AESNI_GCM_PMD crypto_aesni_gcm
59 #define CRYPTODEV_NAME_OPENSSL_PMD crypto_openssl
61 #define CRYPTODEV_NAME_QAT_SYM_PMD crypto_qat
63 #define CRYPTODEV_NAME_SNOW3G_PMD crypto_snow3g
65 #define CRYPTODEV_NAME_KASUMI_PMD crypto_kasumi
67 #define CRYPTODEV_NAME_ZUC_PMD crypto_zuc
82 extern const char **rte_cyptodev_names;
86 #define CDEV_LOG_ERR(...) \
87 RTE_LOG(ERR, CRYPTODEV, \
88 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
89 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
91 #define CDEV_PMD_LOG_ERR(dev, ...) \
92 RTE_LOG(ERR, CRYPTODEV, \
93 RTE_FMT("[%s] %s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
94 dev, __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
96 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
97 #define CDEV_LOG_DEBUG(...) \
98 RTE_LOG(DEBUG, CRYPTODEV, \
99 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
100 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
102 #define CDEV_PMD_TRACE(...) \
103 RTE_LOG(DEBUG, CRYPTODEV, \
104 RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
105 dev, __func__, RTE_FMT_TAIL(__VA_ARGS__,)))
108 #define CDEV_LOG_DEBUG(...) (void)0
109 #define CDEV_PMD_TRACE(...) (void)0
200 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
201 { RTE_CRYPTO_OP_TYPE_UNDEFINED }
212 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
214 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
216 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
218 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
220 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
222 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
224 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
226 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
262 #define RTE_CRYPTODEV_DETACHED (0)
263 #define RTE_CRYPTODEV_ATTACHED (1)
303 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS 8
304 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS 2048
310 struct rte_crypto_vdev_init_params {
311 unsigned max_nb_queue_pairs;
312 unsigned max_nb_sessions;
329 struct rte_crypto_vdev_init_params *params,
330 const char *input_args);
381 rte_cryptodev_socket_id(uint8_t dev_id);
604 struct rte_cryptodev_callback;
607 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
639 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
709 static inline uint16_t
752 static inline uint16_t
struct rte_cryptodev_symmetric_capability::@26::@28::@30 key_size
void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
struct rte_cryptodev_symmetric_capability sym
struct rte_pci_device * pci_dev
const char * rte_cryptodev_get_feature_name(uint64_t flag)
struct rte_cryptodev_symmetric_capability::@26::@28::@32 aad_size
struct rte_cryptodev_sym_session * rte_cryptodev_sym_session_free(uint8_t dev_id, struct rte_cryptodev_sym_session *session)
enum rte_crypto_auth_algorithm algo
int rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
int rte_cryptodev_queue_pair_start(uint8_t dev_id, uint16_t queue_pair_id)
static uint16_t rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
enum rte_crypto_op_type op
TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback)
__extension__ uint8_t attached
struct rte_mempool * session_pool
uint64_t dequeue_err_count
dequeue_pkt_burst_t dequeue_burst
int rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params, const char *input_args)
int rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
char name[RTE_CRYPTODEV_NAME_MAX_LEN]
int rte_cryptodev_callback_unregister(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
const struct rte_cryptodev_capabilities * capabilities
void rte_cryptodev_stop(uint8_t dev_id)
int rte_cryptodev_close(uint8_t dev_id)
void(* rte_cryptodev_cb_fn)(uint8_t dev_id, enum rte_cryptodev_event_type event, void *cb_arg)
struct rte_cryptodev_symmetric_capability::@26::@29 cipher
int rte_cryptodev_callback_register(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
struct rte_cryptodev_symmetric_capability::@26::@28::@31 digest_size
int rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
#define RTE_CRYPTODEV_NAME_MAX_LEN
enqueue_pkt_burst_t enqueue_burst
static uint16_t rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
int rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
struct rte_cryptodev_data * data
struct rte_cryptodev_cb_list link_intr_cbs
struct rte_cryptodev_config::@38 session_mp
enum rte_cryptodev_type dev_type
uint8_t rte_cryptodev_count(void)
__extension__ uint8_t dev_started
struct rte_cryptodev_symmetric_capability::@26::@29::@34 iv_size
__extension__ char _private[0]
struct rte_cryptodev_ops * dev_ops
enum rte_cryptodev_type dev_type
rte_crypto_auth_algorithm
rte_crypto_sym_xform_type
int rte_cryptodev_start(uint8_t dev_id)
uint16_t(* enqueue_pkt_burst_t)(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
uint64_t enqueue_err_count
struct rte_cryptodev_sym_session * rte_cryptodev_sym_session_create(uint8_t dev_id, struct rte_crypto_sym_xform *xform)
uint16_t(* dequeue_pkt_burst_t)(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id)
#define __rte_cache_aligned
RTE_STD_C11 struct rte_cryptodev_sym_session::@39 __rte_aligned(8)
struct rte_cryptodev_symmetric_capability::@26::@28 auth
struct rte_pci_device * pci_dev
int rte_cryptodev_create_vdev(const char *name, const char *args)
const struct rte_cryptodev_driver * driver
enum rte_crypto_sym_xform_type xform_type
void rte_cryptodev_stats_reset(uint8_t dev_id)
int rte_cryptodev_get_dev_id(const char *name)
unsigned max_nb_queue_pairs
struct rte_cryptodev * rte_cryptodevs
rte_crypto_cipher_algorithm