5 #ifndef _RTE_CRYPTODEV_H_
6 #define _RTE_CRYPTODEV_H_
25 #include <rte_config.h>
27 extern const char **rte_cyptodev_names;
31 #define CDEV_LOG_ERR(...) \
32 RTE_LOG(ERR, CRYPTODEV, \
33 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
34 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
36 #define CDEV_LOG_INFO(...) \
37 RTE_LOG(INFO, CRYPTODEV, \
38 RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
39 RTE_FMT_TAIL(__VA_ARGS__,)))
41 #define CDEV_LOG_DEBUG(...) \
42 RTE_LOG(DEBUG, CRYPTODEV, \
43 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
44 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
46 #define CDEV_PMD_TRACE(...) \
47 RTE_LOG(DEBUG, CRYPTODEV, \
48 RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
49 dev, __func__, RTE_FMT_TAIL(__VA_ARGS__,)))
64 #define rte_crypto_op_ctod_offset(c, t, o) \
65 ((t)((char *)(c) + (o)))
78 #define rte_crypto_op_ctophys_offset(c, o) \
79 (rte_iova_t)((c)->phys_addr + (o))
252 uint16_t key_size, uint16_t iv_size);
270 uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
289 uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
302 int __rte_experimental
317 int __rte_experimental
335 const char *algo_string);
350 const char *algo_string);
365 const char *algo_string);
378 int __rte_experimental
380 const char *xform_string);
384 #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \
385 { RTE_CRYPTO_OP_TYPE_UNDEFINED }
396 #define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0)
398 #define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1)
400 #define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2)
402 #define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3)
404 #define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4)
406 #define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5)
408 #define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6)
410 #define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7)
414 #define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8)
416 #define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9)
420 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10)
424 #define RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT (1ULL << 11)
429 #define RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT (1ULL << 12)
433 #define RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT (1ULL << 13)
435 #define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14)
437 #define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15)
439 #define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16)
485 #define RTE_CRYPTODEV_DETACHED (0)
486 #define RTE_CRYPTODEV_ATTACHED (1)
526 #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
600 rte_cryptodev_socket_id(uint8_t dev_id);
793 struct rte_cryptodev_callback;
796 TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
829 rte_cryptodev_get_sec_ctx(uint8_t dev_id);
898 static inline uint16_t
941 static inline uint16_t
1018 int __rte_experimental
1058 int __rte_experimental
1092 int __rte_experimental
1111 unsigned int __rte_experimental
1138 unsigned int __rte_experimental
1173 int __rte_experimental
1189 void * __rte_experimental
int __rte_experimental rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, const char *xform_string)
int rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum, const char *algo_string)
int rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum, const char *algo_string)
void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
struct rte_cryptodev_symmetric_capability sym
__extension__ void * sess_private_data[0]
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, struct rte_mempool *session_pool)
const char * rte_cryptodev_get_feature_name(uint64_t flag)
const struct rte_cryptodev_asymmetric_xform_capability *__rte_experimental rte_cryptodev_asym_capability_get(uint8_t dev_id, const struct rte_cryptodev_asym_capability_idx *idx)
enum rte_crypto_auth_algorithm algo
uint8_t rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices)
rte_crypto_asym_xform_type
static uint16_t rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)
struct rte_crypto_param_range digest_size
enum rte_crypto_op_type op
int rte_cryptodev_driver_id_get(const char *name)
int rte_cryptodev_sym_session_clear(uint8_t dev_id, struct rte_cryptodev_sym_session *sess)
TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback)
__extension__ uint8_t attached
int __rte_experimental rte_cryptodev_asym_xform_capability_check_modlen(const struct rte_cryptodev_asymmetric_xform_capability *capability, uint16_t modlen)
int rte_cryptodev_sym_session_init(uint8_t dev_id, struct rte_cryptodev_sym_session *sess, struct rte_crypto_sym_xform *xforms, struct rte_mempool *mempool)
struct rte_mempool * session_pool
uint64_t dequeue_err_count
int rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, const char *algo_string)
const struct rte_cryptodev_symmetric_capability * rte_cryptodev_sym_capability_get(uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx)
dequeue_pkt_burst_t dequeue_burst
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)
enum rte_crypto_asym_xform_type type
__extension__ void * sess_private_data[0]
int __rte_experimental rte_cryptodev_sym_session_set_user_data(struct rte_cryptodev_sym_session *sess, void *data, uint16_t size)
void(* rte_cryptodev_cb_fn)(uint8_t dev_id, enum rte_cryptodev_event_type event, void *cb_arg)
int rte_cryptodev_sym_capability_check_aead(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t digest_size, uint16_t aad_size, uint16_t iv_size)
unsigned int __rte_experimental rte_cryptodev_asym_get_header_session_size(void)
void *__rte_experimental rte_cryptodev_sym_session_get_user_data(struct rte_cryptodev_sym_session *sess)
unsigned int rte_cryptodev_sym_get_header_session_size(void)
const char * rte_cryptodev_driver_name_get(uint8_t driver_id)
int rte_cryptodev_callback_register(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)
uint16_t min_mbuf_tailroom_req
int __rte_experimental rte_cryptodev_asym_session_init(uint8_t dev_id, struct rte_cryptodev_asym_session *sess, struct rte_crypto_asym_xform *xforms, struct rte_mempool *mempool)
struct rte_cryptodev_sym_session * rte_cryptodev_sym_session_create(struct rte_mempool *mempool)
int rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess)
const char * rte_cryptodev_name_get(uint8_t dev_id)
#define RTE_CRYPTODEV_NAME_MAX_LEN
int __rte_experimental rte_cryptodev_asym_session_clear(uint8_t dev_id, struct rte_cryptodev_asym_session *sess)
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_sym_capability_check_cipher(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t iv_size)
int rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
struct rte_cryptodev_data * data
struct rte_cryptodev_asym_session *__rte_experimental rte_cryptodev_asym_session_create(struct rte_mempool *mempool)
struct rte_cryptodev_cb_list link_intr_cbs
struct rte_device * device
uint8_t rte_cryptodev_count(void)
__extension__ uint8_t dev_started
unsigned int __rte_experimental rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
int rte_cryptodev_sym_capability_check_auth(const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
struct rte_cryptodev_ops * dev_ops
uint16_t min_mbuf_headroom_req
unsigned int rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
rte_crypto_auth_algorithm
rte_crypto_sym_xform_type
int __rte_experimental rte_cryptodev_asym_session_free(struct rte_cryptodev_asym_session *sess)
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
uint16_t(* dequeue_pkt_burst_t)(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
struct rte_cryptodev_symmetric_capability::@100::@103 cipher
uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id)
struct rte_crypto_param_range key_size
#define __rte_cache_aligned
struct rte_device * device
struct rte_crypto_param_range aad_size
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
uint8_t rte_cryptodev_device_count_by_driver(uint8_t driver_id)
struct rte_cryptodev_symmetric_capability::@100::@102 auth
struct rte_crypto_param_range iv_size
struct rte_cryptodev * rte_cryptodevs
struct rte_cryptodev_asymmetric_capability asym
rte_crypto_aead_algorithm
int __rte_experimental rte_cryptodev_asym_xform_capability_check_optype(const struct rte_cryptodev_asymmetric_xform_capability *capability, enum rte_crypto_asym_op_type op_type)
rte_crypto_cipher_algorithm