rte_cryptodev.h(3)
π rte_cryptodev.h π
okay bestie, gather round π«Ά this is rte_cryptodev.h(3), and it lives in the Library Functions Manual. she's a header file, she's iconic, she's the whole CryptoDev vibe, and we're gonna go through every single thing she contains. no skimming. no skipping. we respect her. π
β¨ NAME β¨
rte_cryptodev.h
that's it. that's the name. short, sweet, main character energy. π
πΈ SYNOPSIS πΈ
first things first, you gotta pull her in. all of these includes, exactly like this, no cap:
#include <rte_compat.h>
#include 'rte_kvargs.h'
#include 'rte_crypto.h'
#include <rte_common.h>
#include <rte_rcu_qsbr.h>
#include 'rte_cryptodev_trace_fp.h'
#include 'rte_cryptodev_core.h'
(ngl the mix of angle brackets and quotes is so her β she contains multitudes π¦)
π Data Structures π
bestie. look at this roster. fourteen structs/union and every single one of them is doing something:
struct rte_crypto_param_rangestruct rte_cryptodev_symmetric_capabilitystruct rte_cryptodev_asymmetric_xform_capabilitystruct rte_cryptodev_asymmetric_capabilitystruct rte_cryptodev_capabilitiesstruct rte_cryptodev_sym_capability_idxstruct rte_cryptodev_asym_capability_idxstruct rte_cryptodev_infostruct rte_cryptodev_qp_confstruct rte_cryptodev_statsstruct rte_cryptodev_configstruct rte_cryptodev_cbunion rte_cryptodev_session_ctxstruct rte_crypto_raw_dp_ctx
symmetric this, asymmetric that, capabilities, configs, stats, callbacksβ¦ she's booked and busy fr fr πβ¨
π₯ Macros π₯
okay this is the big one. the feature-flag section. it's giving β¨bitmask fantasyβ¨ and honestly? obsessed.
a couple of helpers up top:
rte_crypto_op_ctod_offset(c, t, o)rte_crypto_op_ctophys_offset(c, o)RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTESβ defined asRTE_BIT32(0)π«ΆRTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()β the little "we're done here" marker for a capabilities list, lowkey the most polite macro in the whole file π
and now, the feature flags β every single one, in order, no gatekeeping:
RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTOβ(1ULL << 0)β the symmetric crypto feature bitRTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTOβ(1ULL << 1)β the asymmetric crypto feature bitRTE_CRYPTODEV_FF_SYM_OPERATION_CHAININGβ(1ULL << 2)β the symmetric operation chaining feature bitRTE_CRYPTODEV_FF_CPU_SSEβ(1ULL << 3)β the CPU SSE feature bitRTE_CRYPTODEV_FF_CPU_AVXβ(1ULL << 4)β the CPU AVX feature bitRTE_CRYPTODEV_FF_CPU_AVX2β(1ULL << 5)β the CPU AVX2 feature bitRTE_CRYPTODEV_FF_CPU_AESNIβ(1ULL << 6)β the CPU AESNI feature bitRTE_CRYPTODEV_FF_HW_ACCELERATEDβ(1ULL << 7)β the HW accelerated feature bitRTE_CRYPTODEV_FF_CPU_AVX512β(1ULL << 8)β the CPU AVX512 feature bitRTE_CRYPTODEV_FF_IN_PLACE_SGLβ(1ULL << 9)β the in-place SGL feature bitRTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUTβ(1ULL << 10)β the out-of-place SGL-in / SGL-out feature bitRTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUTβ(1ULL << 11)β the out-of-place SGL-in / LB-out feature bitRTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUTβ(1ULL << 12)β the out-of-place LB-in / SGL-out feature bitRTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUTβ(1ULL << 13)β the out-of-place LB-in / LB-out feature bitRTE_CRYPTODEV_FF_CPU_NEONβ(1ULL << 14)β the CPU NEON feature bitRTE_CRYPTODEV_FF_CPU_ARM_CEβ(1ULL << 15)β the CPU ARM CE feature bitRTE_CRYPTODEV_FF_SECURITYβ(1ULL << 16)β the security feature bitRTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXPβ(1ULL << 17)β the RSA private-op key-exp feature bitRTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QTβ(1ULL << 18)β the RSA private-op key-QT feature bitRTE_CRYPTODEV_FF_DIGEST_ENCRYPTEDβ(1ULL << 19)β the digest-encrypted feature bitRTE_CRYPTODEV_FF_ASYM_SESSIONLESSβ(1ULL << 20)β the asym sessionless feature bitRTE_CRYPTODEV_FF_SYM_CPU_CRYPTOβ(1ULL << 21)β the sym CPU crypto feature bitRTE_CRYPTODEV_FF_SYM_SESSIONLESSβ(1ULL << 22)β the sym sessionless feature bitRTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATAβ(1ULL << 23)β the non-byte-aligned data feature bitRTE_CRYPTODEV_FF_SYM_RAW_DPβ(1ULL << 24)β the sym raw data-path feature bitRTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITSβ(1ULL << 25)β the cipher-multiple-data-units feature bitRTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEYβ(1ULL << 26)β the cipher wrapped key feature bitRTE_CRYPTODEV_FF_SECURITY_INNER_CSUMβ(1ULL << 27)β the security inner checksum feature bitRTE_CRYPTODEV_FF_SECURITY_RX_INJECTβ(1ULL << 28)β the security RX inject feature bitRTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASHβ(1ULL << 29)β the MLDSA sign prehash feature bit
look at that bit-shift ladder from 0 all the way up to 29 π she really said "one bit per vibe" and committed. periodt.
then the queue-pair priorities, which are just numbers sitting there being dramatic:
RTE_CRYPTODEV_QP_PRIORITY_HIGHESTβ0RTE_CRYPTODEV_QP_PRIORITY_NORMALβ128RTE_CRYPTODEV_QP_PRIORITY_LOWESTβ255
(not the 0 being the highest priority and 255 being the lowest π she's quirky like that, we love her anyway)
and one last one, the name-length cap:
RTE_CRYPTODEV_NAME_MAX_LENβ(64)
π¦ Typedefs π¦
these are the function-pointer girlies and they're ALL here, signatures verbatim, do not touch:
rte_cryptodev_callback_fnβtypedef uint16_t(* rte_cryptodev_callback_fn) (uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops, void *user_param)rte_cryptodev_cb_fnβtypedef void(* rte_cryptodev_cb_fn) (uint8_t dev_id, enum rte_cryptodev_event_type event, void *cb_arg)cryptodev_sym_raw_enqueue_burst_tβtypedef uint32_t(* cryptodev_sym_raw_enqueue_burst_t) (void *qp, uint8_t *drv_ctx, struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs, void *user_data[], int *enqueue_status)cryptodev_sym_raw_enqueue_tβtypedef int(* cryptodev_sym_raw_enqueue_t) (void *qp, uint8_t *drv_ctx, struct rte_crypto_vec *data_vec, uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *aad_or_auth_iv, void *user_data)cryptodev_sym_raw_operation_done_tβtypedef int(* cryptodev_sym_raw_operation_done_t) (void *qp, uint8_t *drv_ctx, uint32_t n)rte_cryptodev_raw_get_dequeue_count_tβtypedef uint32_t(* rte_cryptodev_raw_get_dequeue_count_t) (void *user_data)rte_cryptodev_raw_post_dequeue_tβtypedef void(* rte_cryptodev_raw_post_dequeue_t) (void *user_data, uint32_t index, uint8_t is_op_success)cryptodev_sym_raw_dequeue_burst_tβtypedef uint32_t(* cryptodev_sym_raw_dequeue_burst_t) (void *qp, uint8_t *drv_ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status)cryptodev_sym_raw_dequeue_tβtypedef void *(* cryptodev_sym_raw_dequeue_t) (void *qp, uint8_t *drv_ctx, int *dequeue_status, enum rte_crypto_op_status *op_status)
the raw data-path typedefs alone are giving "I've been to therapy" energy π but they're all preserved exactly, bestie, down to the last pointer. π«Ά
π Enumerations π
one enum. one. and it's a whole mood:
enum rte_cryptodev_event_type with these values, in this exact order:
RTE_CRYPTODEV_EVENT_UNKNOWNRTE_CRYPTODEV_EVENT_ERRORRTE_CRYPTODEV_EVENT_MAX
RTE_CRYPTODEV_EVENT_UNKNOWN β RTE_CRYPTODEV_EVENT_ERROR β RTE_CRYPTODEV_EVENT_MAX. she starts mysterious, ends with a max sentinel, classic. β¨
β¨ Functions β¨
okay bestie, hereβs the whole squad of function prototypes from this header β every single one, in the exact order, no skips, no cap. Theyβre the building blocks for cipher and auth ops, and theyβre all iconic in their own way. π
const struct rte_cryptodev_symmetric_capability * rte_cryptodev_sym_capability_get (uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx)const struct rte_cryptodev_asymmetric_xform_capability * rte_cryptodev_asym_capability_get (uint8_t dev_id, const struct rte_cryptodev_asym_capability_idx *idx)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_sym_capability_check_auth (const struct rte_cryptodev_symmetric_capability *capability, uint16_t key_size, uint16_t digest_size, uint16_t iv_size)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)int rte_cryptodev_asym_xform_capability_check_optype (const struct rte_cryptodev_asymmetric_xform_capability *capability, enum rte_crypto_asym_op_type op_type)int rte_cryptodev_asym_xform_capability_check_modlen (const struct rte_cryptodev_asymmetric_xform_capability *capability, uint16_t modlen)bool rte_cryptodev_asym_xform_capability_check_hash (const struct rte_cryptodev_asymmetric_xform_capability *capability, enum rte_crypto_auth_algorithm hash)__rte_experimental int rte_cryptodev_asym_xform_capability_check_opcap (const struct rte_cryptodev_asymmetric_xform_capability *capability, enum rte_crypto_asym_op_type op_type, uint8_t cap)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)int rte_cryptodev_get_aead_algo_enum (enum rte_crypto_aead_algorithm *algo_enum, const char *algo_string)int rte_cryptodev_asym_get_xform_enum (enum rte_crypto_asym_xform_type *xform_enum, const char *xform_string)__rte_experimental const char * rte_cryptodev_get_cipher_algo_string (enum rte_crypto_cipher_algorithm algo_enum)__rte_experimental const char * rte_cryptodev_get_auth_algo_string (enum rte_crypto_auth_algorithm algo_enum)__rte_experimental const char * rte_cryptodev_get_aead_algo_string (enum rte_crypto_aead_algorithm algo_enum)__rte_experimental const char * rte_cryptodev_asym_get_xform_string (enum rte_crypto_asym_xform_type xform_enum)const char * rte_cryptodev_get_feature_name (uint64_t flag)int rte_cryptodev_get_dev_id (const char *name)const char * rte_cryptodev_name_get (uint8_t dev_id)uint8_t rte_cryptodev_count (void)uint8_t rte_cryptodev_device_count_by_driver (uint8_t driver_id)uint8_t rte_cryptodev_devices_get (const char *driver_name, uint8_t *devices, uint8_t nb_devices)int rte_cryptodev_configure (uint8_t dev_id, struct rte_cryptodev_config *config)int rte_cryptodev_start (uint8_t dev_id)void rte_cryptodev_stop (uint8_t dev_id)int rte_cryptodev_close (uint8_t dev_id)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)__rte_experimental int rte_cryptodev_queue_pair_reset (uint8_t dev_id, uint16_t queue_pair_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)int rte_cryptodev_get_qp_status (uint8_t dev_id, uint16_t queue_pair_id)uint16_t rte_cryptodev_queue_pair_count (uint8_t dev_id)int rte_cryptodev_stats_get (uint8_t dev_id, struct rte_cryptodev_stats *stats)void rte_cryptodev_stats_reset (uint8_t dev_id)void rte_cryptodev_info_get (uint8_t dev_id, struct rte_cryptodev_info *dev_info)int rte_cryptodev_callback_register (uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)int rte_cryptodev_callback_unregister (uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg)__rte_experimental int rte_cryptodev_queue_pair_event_error_query (uint8_t dev_id, uint16_t qp_id)RTE_TAILQ_HEAD (rte_cryptodev_cb_list, rte_cryptodev_callback)void * rte_cryptodev_get_sec_ctx (uint8_t dev_id)struct rte_mempool * rte_cryptodev_sym_session_pool_create (const char *name, uint32_t nb_elts, uint32_t elt_size, uint32_t cache_size, uint16_t priv_size, int socket_id)struct rte_mempool * rte_cryptodev_asym_session_pool_create (const char *name, uint32_t nb_elts, uint32_t cache_size, uint16_t user_data_size, int socket_id)void * rte_cryptodev_sym_session_create (uint8_t dev_id, struct rte_crypto_sym_xform *xforms, struct rte_mempool *mp)int rte_cryptodev_asym_session_create (uint8_t dev_id, struct rte_crypto_asym_xform *xforms, struct rte_mempool *mp, void **session)int rte_cryptodev_sym_session_free (uint8_t dev_id, void *sess)int rte_cryptodev_asym_session_free (uint8_t dev_id, void *sess)unsigned int rte_cryptodev_asym_get_header_session_size (void)unsigned int rte_cryptodev_sym_get_private_session_size (uint8_t dev_id)unsigned int rte_cryptodev_asym_get_private_session_size (uint8_t dev_id)unsigned int rte_cryptodev_is_valid_dev (uint8_t dev_id)int rte_cryptodev_driver_id_get (const char *name)const char * rte_cryptodev_driver_name_get (uint8_t driver_id)int rte_cryptodev_sym_session_set_user_data (void *sess, void *data, uint16_t size)static uint64_t rte_cryptodev_sym_session_opaque_data_get (void *sess)static void rte_cryptodev_sym_session_opaque_data_set (void *sess, uint64_t opaque)void * rte_cryptodev_sym_session_get_user_data (void *sess)int rte_cryptodev_asym_session_set_user_data (void *sess, void *data, uint16_t size)void * rte_cryptodev_asym_session_get_user_data (void *sess)uint32_t rte_cryptodev_sym_cpu_crypto_process (uint8_t dev_id, void *sess, union rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec *vec)int rte_cryptodev_get_raw_dp_ctx_size (uint8_t dev_id)int rte_cryptodev_session_event_mdata_set (uint8_t dev_id, void *sess, enum rte_crypto_op_type op_type, enum rte_crypto_op_sess_type sess_type, void *ev_mdata, uint16_t size)int rte_cryptodev_configure_raw_dp_ctx (uint8_t dev_id, uint16_t qp_id, struct rte_crypto_raw_dp_ctx *ctx, enum rte_crypto_op_sess_type sess_type, union rte_cryptodev_session_ctx session_ctx, uint8_t is_update)uint32_t rte_cryptodev_raw_enqueue_burst (struct rte_crypto_raw_dp_ctx *ctx, struct rte_crypto_sym_vec *vec, union rte_crypto_sym_ofs ofs, void **user_data, int *enqueue_status)static __rte_experimental __rte_always_inline int rte_cryptodev_raw_enqueue (struct rte_crypto_raw_dp_ctx *ctx, struct rte_crypto_vec *data_vec, uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *aad_or_auth_iv, void *user_data)int rte_cryptodev_raw_enqueue_done (struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)uint32_t rte_cryptodev_raw_dequeue_burst (struct rte_crypto_raw_dp_ctx *ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status)static __rte_experimental __rte_always_inline void * rte_cryptodev_raw_dequeue (struct rte_crypto_raw_dp_ctx *ctx, int *dequeue_status, enum rte_crypto_op_status *op_status)int rte_cryptodev_raw_dequeue_done (struct rte_crypto_raw_dp_ctx *ctx, uint32_t n)struct rte_cryptodev_cb * rte_cryptodev_add_enq_callback (uint8_t dev_id, uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void *cb_arg)int rte_cryptodev_remove_enq_callback (uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)struct rte_cryptodev_cb * rte_cryptodev_add_deq_callback (uint8_t dev_id, uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void *cb_arg)int rte_cryptodev_remove_deq_callback (uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb *cb)static uint16_t rte_cryptodev_dequeue_burst (uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)static uint16_t rte_cryptodev_enqueue_burst (uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops)static __rte_experimental int rte_cryptodev_qp_depth_used (uint8_t dev_id, uint16_t qp_id)
π Detailed Description π
So basically, this whole header is the RTE Cryptographic Device APIs π. Itβs defining the RTE Crypto Device APIs for the provisioning of cipher and authentication operations. Thatβs the entire vibe, no cap.
Definition in file rte_cryptodev.h. π
π§ Macro Definition Documentation π§
Okay bestie, this section is the macro vault. Little preprocessor besties that do very specific things. Let's go π
β¨ #define rte_crypto_op_ctod_offset( c, t, o)
A macro that points to an offset from the start of the crypto operation structure (rte_crypto_op).
The returned pointer is cast to type t.
Value:
((t)((char *)(c) + (o)))
Parameters:
cβ the crypto operation.oβ the offset from the start of the crypto operation.tβ the type to cast the result into.
Definition at line 64 of file rte_cryptodev.h.
β¨ #define rte_crypto_op_ctophys_offset( c, o)
A macro that returns the physical address that points to an offset from the start of the crypto operation (rte_crypto_op). iykyk, it's the IOVA version π«Ά
Value:
(rte_iova_t)((c)->phys_addr + (o))
Parameters:
cβ the crypto operation.oβ the offset from the start of the crypto operation to calculate the address from.
Definition at line 78 of file rte_cryptodev.h.
β¨ #define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES RTE_BIT32(0)
Data-unit supported lengths of cipher algorithms. A bit can represent any set of data-unit sizes β single size, multiple size, range, etc. So it's giving "one bit, many vibes" π
Definition at line 100 of file rte_cryptodev.h.
β¨ #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
Macro used at the end of a crypto PMD list. The closer. The periodt at the end of the sentence π
Value:
{ RTE_CRYPTO_OP_TYPE_UNDEFINED }
Definition at line 508 of file rte_cryptodev.h.
π Crypto device supported feature flags π
Heads up bestie: new feature flags should be added to the end of the list. And keep these flags synchronised with rte_cryptodev_get_feature_name(). No cap, that's in the docs fr fr.
RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO(1ULL << 0) β symmetric crypto operations are supported. π Definition at line 520 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO(1ULL << 1) β asymmetric crypto operations are supported. β¨ Definition at line 522 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING(1ULL << 2) β chaining symmetric crypto operations is supported. π Definition at line 524 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_SSE(1ULL << 3) β utilises CPU SIMD SSE instructions. π₯οΈ Definition at line 526 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_AVX(1ULL << 4) β utilises CPU SIMD AVX instructions. π₯οΈ Definition at line 528 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_AVX2(1ULL << 5) β utilises CPU SIMD AVX2 instructions. π₯οΈ Definition at line 530 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_AESNI(1ULL << 6) β utilises CPU AES-NI instructions. π Definition at line 532 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_HW_ACCELERATED(1ULL << 7) β operations are off-loaded to an external hardware accelerator. π Definition at line 534 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_AVX512(1ULL << 8) β utilises CPU SIMD AVX512 instructions. π₯οΈ Definition at line 538 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_IN_PLACE_SGL(1ULL << 9) β in-place Scatter-gather (SGL) buffers, with multiple segments, are supported. πΈ Definition at line 540 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT(1ULL << 10) β out-of-place Scatter-gather (SGL) buffers are supported in input and output. π¦ Definition at line 544 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT(1ULL << 11) β out-of-place Scatter-gather (SGL) buffers are supported in input, combined with linear buffers (LB), with a single segment in output. π Definition at line 548 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT(1ULL << 12) β out-of-place Scatter-gather (SGL) buffers are supported in output, combined with linear buffers (LB) in input. π Definition at line 553 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT(1ULL << 13) β out-of-place linear buffers (LB) are supported in input and output. π Definition at line 557 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_NEON(1ULL << 14) β utilises CPU NEON instructions. π₯οΈ Definition at line 559 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CPU_ARM_CE(1ULL << 15) β utilises ARM CPU Cryptographic Extensions. π Definition at line 561 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SECURITY(1ULL << 16) β support Security Protocol Processing. π‘οΈ Definition at line 563 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP(1ULL << 17) β support RSA Private Key OP with exponent. π Definition at line 565 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT(1ULL << 18) β support RSA Private Key OP with CRT (quintuple) Keys. π Definition at line 567 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED(1ULL << 19) β support encrypted-digest operations where digest is appended to data. π Definition at line 569 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_ASYM_SESSIONLESS(1ULL << 20) β support asymmetric session-less operations. π Definition at line 571 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO(1ULL << 21) β support symmetric cpu-crypto processing. π Definition at line 573 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SYM_SESSIONLESS(1ULL << 22) β support symmetric session-less operations. π Definition at line 575 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA(1ULL << 23) β support operations on data which is not byte aligned. π (chaotic, but valid) Definition at line 577 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SYM_RAW_DP(1ULL << 24) β support accelerator specific symmetric raw data-path APIs. π₯ Definition at line 579 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS(1ULL << 25) β support operations on multiple data-units message. π Definition at line 581 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY(1ULL << 26) β support wrapped key in cipher xform. π Definition at line 583 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM(1ULL << 27) β support inner checksum computation/verification. β Definition at line 585 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_SECURITY_RX_INJECT(1ULL << 28) β support Rx injection after security processing. π Definition at line 587 of filerte_cryptodev.h.RTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASH(1ULL << 29) β support Pre Hash ML-DSA Signature Generation. βοΈ Definition at line 589 of filerte_cryptodev.h.
π Queue pair priorities π
RTE_CRYPTODEV_QP_PRIORITY_HIGHESTβ0. The highest priority of a cryptodev queue pair. Main character energy, obviously π See also:rte_cryptodev_queue_pair_setup(),rte_cryptodev_enqueue_burst()Definition at line 646 of filerte_cryptodev.h.RTE_CRYPTODEV_QP_PRIORITY_NORMALβ128. Normal priority of a cryptodev queue pair. Just vibing π See also:rte_cryptodev_queue_pair_setup(),rte_cryptodev_enqueue_burst()Definition at line 650 of filerte_cryptodev.h.RTE_CRYPTODEV_QP_PRIORITY_LOWESTβ255. Lowest priority of a cryptodev queue pair. Bestie in the back of the group chat π See also:rte_cryptodev_queue_pair_setup(),rte_cryptodev_enqueue_burst()Definition at line 654 of filerte_cryptodev.h.
β¨ #define RTE_CRYPTODEV_NAME_MAX_LEN (64)
Max length of name of crypto PMD. Sixty-four characters to name your little guy β make it count π
Definition at line 726 of file rte_cryptodev.h.
typedef rte_cryptodev_callback_fn π
typedef uint16_t(* rte_cryptodev_callback_fn) (uint16_t dev_id, uint16_t qp_id,
struct rte_crypto_op **ops,
uint16_t nb_ops, void *user_param)
okay so this is the function type you use for processing crypto ops when an enqueue/dequeue burst gets called. bestie, listen β this callback fires on enqueue/dequeue burst immediately. like, right then. no waiting room. β¨
Parameters
dev_idβ the identifier of the device.qp_idβ the index of the queue pair on which ops are enqueued/dequeued. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.opsβ the address of an array ofnb_opspointers torte_crypto_opstructures which contain the crypto operations to be processed.nb_opsβ the number of operations to process.user_paramβ the arbitrary user parameter passed in by the application when the callback was originally registered.
Returns
- The number of ops to be enqueued to the crypto device.
Definition at line 697 of file rte_cryptodev.h.
typedef rte_cryptodev_cb_fn π
typedef void(* rte_cryptodev_cb_fn) (uint8_t dev_id,
enum rte_cryptodev_event_type event,
void *cb_arg)
This is the typedef for the application callback function that you (the app software) register so you get notified about device events. it's giving "call me when something happens" energy fr fr π
Parameters
dev_idβ Crypto device identifiereventβ Crypto device event to register for notification of.cb_argβ User specified parameter to be passed as to passed to users callback function.
Definition at line 709 of file rte_cryptodev.h.
typedef cryptodev_sym_raw_enqueue_burst_t π¦
typedef uint32_t(* cryptodev_sym_raw_enqueue_burst_t) (void *qp, uint8_t *drv_ctx,
struct rte_crypto_sym_vec *vec,
union rte_crypto_sym_ofs ofs,
void *user_data[],
int *enqueue_status)
Enqueue a vectorized operation descriptor into the device queue β but heads up, the driver may or may not start processing until rte_cryptodev_raw_enqueue_done() is called. so likeβ¦ it might just sit there. chilling. π
Parameters
qpβ Driver specific queue pair data.drv_ctxβ Driver specific context data.vecβ Vectorized operation descriptor.ofsβ Start and stop offsets for auth and cipher operations.user_dataβ The array of user data for dequeue later.enqueue_statusβ Driver written value to specify the enqueue status. Possible values:1: The number of operations returned are enqueued successfully.0: The number of operations returned are cached into the queue but are not processed untilrte_cryptodev_raw_enqueue_done()is called.- negative integer: Error occurred.
Returns
- The number of operations in the descriptor successfully enqueued or cached into the queue but not enqueued yet, depends on the
enqueue_statusvalue.
Definition at line 1452 of file rte_cryptodev.h.
typedef cryptodev_sym_raw_enqueue_t πΈ
typedef int(* cryptodev_sym_raw_enqueue_t) (void *qp, uint8_t *drv_ctx,
struct rte_crypto_vec *data_vec,
uint16_t n_data_vecs,
union rte_crypto_sym_ofs ofs,
struct rte_crypto_va_iova_ptr *iv,
struct rte_crypto_va_iova_ptr *digest,
struct rte_crypto_va_iova_ptr *aad_or_auth_iv,
void *user_data)
Enqueue a single raw data vector into the device queue β but again, the driver may or may not start processing until rte_cryptodev_raw_enqueue_done() is called. same deal, no cap. π
Parameters
qpβ Driver specific queue pair data.drv_ctxβ Driver specific context data.data_vecβ The buffer data vector.n_data_vecsβ Number of buffer data vectors.ofsβ Start and stop offsets for auth and cipher operations.ivβ IV virtual and IOVA addressesdigestβ digest virtual and IOVA addressesaad_or_auth_ivβ AAD or auth IV virtual and IOVA addresses, depends on the algorithm used.user_dataβ The user data.
Returns
1: The data vector is enqueued successfully.0: The data vector is cached into the queue but is not processed untilrte_cryptodev_raw_enqueue_done()is called.- negative integer: failure.
Definition at line 1477 of file rte_cryptodev.h.
typedef cryptodev_sym_raw_operation_done_t β¨
typedef int(* cryptodev_sym_raw_operation_done_t) (void *qp, uint8_t *drv_ctx, uint32_t n)
This one tells the cryptodev queue pair to start processing or finish dequeuing all enqueued/dequeued operations. the lil "okay go bestie" button π«Ά
Parameters
qpβ Driver specific queue pair data.drv_ctxβ Driver specific context data.nβ The total number of processed operations.
Returns
- On success return
0. - On failure return negative integer.
Definition at line 1496 of file rte_cryptodev.h.
typedef rte_cryptodev_raw_get_dequeue_count_t π
typedef uint32_t(* rte_cryptodev_raw_get_dequeue_count_t) (void *user_data)
Typedef that you provide so the driver can get the dequeue count. The function may return a fixed number or the number parsed from the user data stored in the first processed operation. your call, your rules π
Parameters
user_dataβ Dequeued user data.
Returns
- The number of operations to be dequeued.
Definition at line 1508 of file rte_cryptodev.h.
typedef rte_cryptodev_raw_post_dequeue_t β
typedef void(* rte_cryptodev_raw_post_dequeue_t) (void *user_data, uint32_t index,
uint8_t is_op_success)
Typedef that you provide to deal with the post-dequeue step β like filling in status and such. the little cleanup ritual after the main event π§
Parameters
user_dataβ Dequeued user data.indexβ Index number of the processed descriptor.is_op_successβ Operation status provided by the driver.
Definition at line 1518 of file rte_cryptodev.h.
typedef cryptodev_sym_raw_dequeue_burst_t π₯
typedef uint32_t(* cryptodev_sym_raw_dequeue_burst_t) (void *qp, uint8_t *drv_ctx,
rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count,
uint32_t max_nb_to_dequeue,
rte_cryptodev_raw_post_dequeue_t post_dequeue,
void **out_user_data,
uint8_t is_user_data_array,
uint32_t *n_success,
int *dequeue_status)
Dequeue a burst of symmetric crypto processing. group chat style: we're pulling a whole batch out at once, periodt.
Parameters
qpβ Driver specific queue pair data.drv_ctxβ Driver specific context data.get_dequeue_countβ User provided callback function to obtain dequeue operation count.max_nb_to_dequeueβ Whenget_dequeue_countisNULLthis value is used to pass the maximum number of operations to be dequeued.post_dequeueβ User provided callback function to post-process a dequeued operation.out_user_dataβ User data pointer array to be retrieve from device queue. In case ofis_user_data_arrayis set there should be enough room to store all user data.is_user_data_arrayβ Set1if every dequeued user data will be written intoout_user_dataarray. Set0if only the first user data will be written intoout_user_dataarray.n_successβ Driver written value to specific the total successful operations count.dequeue_statusβ Driver written value to specify the dequeue status. Possible values:1: Successfully dequeued the number of operations returned. The user data previously set during enqueue is stored in theout_user_data.0: The number of operations returned are completed and the user data is stored in theout_user_data, but they are not freed from the queue untilrte_cryptodev_raw_dequeue_done()is called.- negative integer: Error occurred.
Returns
- The number of operations dequeued or completed but not freed from the queue, depends on
dequeue_statusvalue.
Definition at line 1562 of file rte_cryptodev.h.
typedef cryptodev_sym_raw_dequeue_t π
typedef void *(* cryptodev_sym_raw_dequeue_t) (void *qp, uint8_t *drv_ctx,
int *dequeue_status,
enum rte_crypto_op_status *op_status)
Dequeue a symmetric crypto processing β singular this time, just the one. main character energy but make it one op π
Parameters
qpβ Driver specific queue pair data.drv_ctxβ Driver specific context data.dequeue_statusβ Driver written value to specify the dequeue status. Possible values:1: Successfully dequeued a operation. The user data is returned.0: The first operation in the queue is completed and the user data previously set during enqueue is returned, but it is not freed from the queue untilrte_cryptodev_raw_dequeue_done()is called.- negative integer: Error occurred.
op_statusβ Driver written value to specify operation status.
Returns
- The user data pointer retrieved from device queue or
NULLif no operation is ready for dequeue.
Definition at line 1593 of file rte_cryptodev.h.
Enumeration Type Documentation π
enum rte_cryptodev_event_type π
Definitions of Crypto device event types. the whole roster, bestie π
Enumerator
RTE_CRYPTODEV_EVENT_UNKNOWNβ unknown event typeRTE_CRYPTODEV_EVENT_ERRORβ error interrupt eventRTE_CRYPTODEV_EVENT_MAXβ max value of this enum
Definition at line 639 of file rte_cryptodev.h.
Function Documentation π
rte_cryptodev_sym_capability_get π¦
const struct rte_cryptodev_symmetric_capability *
rte_cryptodev_sym_capability_get (uint8_t dev_id,
const struct rte_cryptodev_sym_capability_idx * idx)
Provide capabilities available for defined device and algorithm. it's giving "what can this thing actually do" β¨
Parameters
dev_idβ The identifier of the device.idxβ Description of crypto algorithms.
Returns
- Return description of the symmetric crypto capability if exist.
- Return
NULLif the capability not exist.
rte_cryptodev_asym_capability_get πΈ
const struct rte_cryptodev_asymmetric_xform_capability *
rte_cryptodev_asym_capability_get (uint8_t dev_id,
const struct rte_cryptodev_asym_capability_idx * idx)
Provide capabilities available for defined device and xform. same vibe check, but asymmetric this time ngl π
Parameters
dev_idβ The identifier of the device.idxβ Description of asym crypto xform.
Returns
- Return description of the asymmetric crypto capability if exist.
- Return
NULLif the capability not exist.
rte_cryptodev_sym_capability_check_cipher π«Ά
int rte_cryptodev_sym_capability_check_cipher (const struct rte_cryptodev_symmetric_capability * capability,
uint16_t key_size,
uint16_t iv_size)
Check if key size and initial vector are supported in crypto cipher capability. lowkey a vibe check for your params π
Parameters
capabilityβ Description of the symmetric crypto capability.key_sizeβ Cipher key size.iv_sizeβ Cipher initial vector size.
Returns
- Return
0if the parameters are in range of the capability. - Return
-1if the parameters are out of range of the capability.
rte_cryptodev_sym_capability_check_auth π
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)
Check if key size and initial vector are supported in crypto auth capability. the auth version of the vibe check, obsessed π
Parameters
capabilityβ Description of the symmetric crypto capability.key_sizeβ Auth key size.digest_sizeβ Auth digest size.iv_sizeβ Auth initial vector size.
Returns
- Return
0if the parameters are in range of the capability. - Return
-1if the parameters are out of range of the capability.
π rte_cryptodev_sym_capability_check_aead
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)
Okay so this one is the AEAD vibe check π β it looks at your capability struct and is like "bestie, are these sizes within my range or not".
Parameters
capabilityβ description of the symmetric crypto capability. your lil' source of truth.key_sizeβ AEAD key size.digest_sizeβ AEAD digest size.aad_sizeβ AEAD AAD size.iv_sizeβ AEAD IV size.
Returns
0if the parameters are in range of the capability. slay β¨-1if the parameters are out of range of the capability. π
π¦ rte_cryptodev_asym_xform_capability_check_optype
int rte_cryptodev_asym_xform_capability_check_optype (const struct rte_cryptodev_asymmetric_xform_capability * capability, enum rte_crypto_asym_op_type op_type)
Check if the op type is supported, no cap π₯
Parameters
capabilityβ description of the asymmetric crypto capability.op_typeβ op type.
Returns
1if the op type is supported π0if unsupported
πΈ rte_cryptodev_asym_xform_capability_check_modlen
int rte_cryptodev_asym_xform_capability_check_modlen (const struct rte_cryptodev_asymmetric_xform_capability * capability, uint16_t modlen)
Check if the modulus length is in the supported range, periodt π
Parameters
capabilityβ description of the asymmetric crypto capability.modlenβ modulus length.
Returns
0if the parameters are in range of the capability. β¨-1if the parameters are out of range of the capability. π
π rte_cryptodev_asym_xform_capability_check_hash
bool rte_cryptodev_asym_xform_capability_check_hash (const struct rte_cryptodev_asymmetric_xform_capability * capability, enum rte_crypto_auth_algorithm hash)
Check if the hash algorithm is supported π§
Parameters
capabilityβ asymmetric crypto capability.hashβ hash algorithm.
Returns
trueif the hash algorithm is supported π«Άfalseif the hash algorithm is not supported
β οΈ rte_cryptodev_asym_xform_capability_check_opcap
__rte_experimental int rte_cryptodev_asym_xform_capability_check_opcap (const struct rte_cryptodev_asymmetric_xform_capability * capability, enum rte_crypto_asym_op_type op_type, uint8_t cap)
π¨ Warning: EXPERIMENTAL: this API may change without prior notice. so likeβ¦ don't get too attached bestie π
Check if the op capability is supported.
Parameters
capabilityβ description of the asymmetric crypto capability.op_typeβ op type.capβ op capability.
Returns
1if the op capability is supported π0if unsupported
π rte_cryptodev_get_cipher_algo_enum
int rte_cryptodev_get_cipher_algo_enum (enum rte_crypto_cipher_algorithm * algo_enum, const char * algo_string)
Hands you back the cipher algorithm enum when you feed it an algorithm string. it's giving translator energy β¨
Parameters
algo_enumβ a pointer to the cipher algorithm enum to be filled.algo_stringβ authentication algo string. (yes, the doc literally says "Authentication" here for a cipher function β we don't make the rules, we just report them π)
Returns
-1if string is not valid0if the string is valid
π rte_cryptodev_get_auth_algo_enum
int rte_cryptodev_get_auth_algo_enum (enum rte_crypto_auth_algorithm * algo_enum, const char * algo_string)
Same deal but for authentication β give it a string, get the authentication algorithm enum back π
Parameters
algo_enumβ a pointer to the authentication algorithm enum to be filled.algo_stringβ authentication algo string.
Returns
-1if string is not valid0if the string is valid
π rte_cryptodev_get_aead_algo_enum
int rte_cryptodev_get_aead_algo_enum (enum rte_crypto_aead_algorithm * algo_enum, const char * algo_string)
And again for AEAD β string goes in, AEAD algorithm enum comes out πΈ
Parameters
algo_enumβ a pointer to the AEAD algorithm enum to be filled.algo_stringβ AEAD algorithm string.
Returns
-1if string is not valid0if the string is valid
π¦ rte_cryptodev_asym_get_xform_enum
int rte_cryptodev_asym_get_xform_enum (enum rte_crypto_asym_xform_type * xform_enum, const char * xform_string)
Give it an xform string, it gives you the asymmetric xform enum. iconic behaviour fr fr π
Parameters
xform_enumβ a pointer to the xform type enum to be filled.xform_stringβ xform string.
Returns
-1if string is not valid0if the string is valid
β¨ rte_cryptodev_get_cipher_algo_string
__rte_experimental const char * rte_cryptodev_get_cipher_algo_string (enum rte_crypto_cipher_algorithm algo_enum)
π¨ EXPERIMENTAL: this API may change without prior notice. proceed with caution bestie
The reverse direction of the algo lookup β give it the enum, it hands back the cipher algorithm string π«Ά
Parameters
algo_enumβ cipher algorithm enum.
Returns
NULLif enum is not validalgo_stringcorresponding to enum
π₯ rte_cryptodev_get_auth_algo_string
__rte_experimental const char * rte_cryptodev_get_auth_algo_string (enum rte_crypto_auth_algorithm algo_enum)
π¨ EXPERIMENTAL: this API may change without prior notice.
Enum in, authentication algorithm string out π
Parameters
algo_enumβ auth algorithm enum.
Returns
NULLif enum is not validalgo_stringcorresponding to enum
π rte_cryptodev_get_aead_algo_string
__rte_experimental const char * rte_cryptodev_get_aead_algo_string (enum rte_crypto_aead_algorithm algo_enum)
π¨ EXPERIMENTAL: this API may change without prior notice.
Enum in, AEAD algorithm string out, no cap π
Parameters
algo_enumβ AEAD algorithm enum.
Returns
NULLif enum is not validalgo_stringcorresponding to enum
π§ rte_cryptodev_asym_get_xform_string
__rte_experimental const char * rte_cryptodev_asym_get_xform_string (enum rte_crypto_asym_xform_type xform_enum)
π¨ EXPERIMENTAL: this API may change without prior notice.
Xform enum in, xform string out β
Parameters
xform_enumβ xform type enum.
Returns
NULL, if enum is not valid.- xform string, for valid enum.
π rte_cryptodev_get_feature_name
const char * rte_cryptodev_get_feature_name (uint64_t flag)
Get the name of a crypto device feature flag, bestie. it's like calling your flag by its government name π
Parameters
flagβ the mask describing the flag.
Returns
The name of this flag, or NULL if it's not a valid feature flag.
πΈ rte_cryptodev_get_dev_id
int rte_cryptodev_get_dev_id (const char * name)
Get the device identifier for the named crypto device β you give the name, it gives you the ID π
Parameters
nameβ device name to select the device structure.
Returns
- Returns crypto device identifier on success. slay β¨
- Return
-1on failure to find named crypto device.
π¦ rte_cryptodev_name_get
const char * rte_cryptodev_name_get (uint8_t dev_id)
The glow-up reversal: device ID in, crypto device name out π
Parameters
dev_idβ the identifier of the device.
Returns
- Returns crypto device name.
- Returns
NULLif crypto device is not present. π
β rte_cryptodev_count
uint8_t rte_cryptodev_count (void )
Get the total number of crypto devices that have been successfully initialised π
Returns
- The total number of usable crypto devices.
π rte_cryptodev_device_count_by_driver
uint8_t rte_cryptodev_device_count_by_driver (uint8_t driver_id)
Get the number of crypto devices of a defined type π
Parameters
driver_idβ driver identifier.
Returns
Returns number of crypto device.
π rte_cryptodev_devices_get
uint8_t rte_cryptodev_devices_get (const char * driver_name, uint8_t * devices, uint8_t nb_devices)
Get the number and the identifiers of attached crypto devices that use the same crypto driver β it's giving "who's in your friend group" energy fr fr π«Ά
Parameters
driver_nameβ driver name.devicesβ output devices identifiers.nb_devicesβ maximal number of devices.
Returns
Returns number of attached crypto device.
π₯ rte_cryptodev_configure
int rte_cryptodev_configure (uint8_t dev_id, struct rte_cryptodev_config * config)
Configure a device.
π This function must be invoked first before any other function in the API. like, first-first. no skipping the line bestie.
This function can also be re-invoked when a device is in the stopped state π
Parameters
dev_idβ the identifier of the device to configure.configβ the crypto device configuration structure.
Returns
0: Success, device configured. β¨<0: Error code returned by the driver configuration function. π
πΈ rte_cryptodev_start
int rte_cryptodev_start (uint8_t dev_id)
Start a device.
The device start step is the last one and consists of setting the configured offload features and in starting the transmit and the receive units of the device. On success, all the basic functions exported by the API (link status, receive/transmit, and so on) can be invoked π
Parameters
dev_idβ the identifier of the device.
Returns
0: Success, device started. π<0: Error code of the driver device start function.
π rte_cryptodev_stop
void rte_cryptodev_stop (uint8_t dev_id)
Stop a device. and the best part?? the device can be restarted with a call to rte_cryptodev_start() π¦ β we love a comeback arc
Parameters
dev_idβ the identifier of the device.
π rte_cryptodev_close
int rte_cryptodev_close (uint8_t dev_id)
Close a device.
π The device cannot be restarted! this is the end of the era, not a pause. once it's closed it's closed, periodt.
Parameters
dev_idβ the identifier of the device.
Returns
0on successfully closing device<0on failure to close device
β rte_cryptodev_queue_pair_setup
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)
Allocate and set up a receive queue pair for a device. let's get this queue pair its own lil' apartment π π
Parameters
dev_idβ the identifier of the device.queue_pair_idβ the index of the queue pairs to set up. The value must be in the range[0, nb_queue_pair - 1]previously supplied torte_cryptodev_configure().qp_confβ the pointer to the configuration data to be used for the queue pair.socket_idβ thesocket_idargument is the socket identifier in case of NUMA. The value can beSOCKET_ID_ANYif there is no NUMA constraint for the DMA memory allocated for the receive queue pair.
Returns
0: Success, queue pair correctly set up. β¨<0: Queue pair configuration failed π
π¨ rte_cryptodev_queue_pair_reset
__rte_experimental int rte_cryptodev_queue_pair_reset (uint8_t dev_id, uint16_t queue_pair_id, const struct rte_cryptodev_qp_conf * qp_conf, int socket_id)
π¨ Warning: EXPERIMENTAL: this API may change without prior notice.
Reset a queue pair for a device. The caller of this API must ensure that there are no enqueues to the queue and there are no pending/inflight packets in the queue when the API is called. like, actually make sure bestie, this is not a drill π The API can reconfigure the queue pair when the queue pair configuration data is provided πΈ
Parameters
dev_idβ the identifier of the device.queue_pair_idβ the index of the queue pairs to set up. The value must be in the range[0, nb_queue_pair - 1]previously supplied torte_cryptodev_configure().qp_confβ the pointer to configuration data to be used for the queue pair. It should beNULL, if the API is called from an interrupt context.socket_idβ thesocket_idargument is the socket identifier in case of NUMA. The value can beSOCKET_ID_ANYif there is no NUMA constraint for the DMA memory allocated for the queue pair.
Returns
0: Queue pair is reset successfully. π«ΆENOTSUP: If the operation is not supported by the PMD.<0: Queue pair reset failed π
π§ rte_cryptodev_get_qp_status
int rte_cryptodev_get_qp_status (uint8_t dev_id, uint16_t queue_pair_id)
Get the status of queue pairs setup on a specific crypto device π
dev_idβ the crypto device identifier, obvi πͺͺqueue_pair_idβ the index of the queue pairs to set up. This value has gotta be in the range[0, nb_queue_pair - 1], and thatnb_queue_pairis the one you already handed torte_cryptodev_configure(). No sneaking in extra QPs bestie π
Returns
0: qp was not configured π΄1: qp was configured β¨-EINVAL: device was not configured, oops π
uint16_t rte_cryptodev_queue_pair_count (uint8_t dev_id)
Get the number of queue pairs on a specific crypto device π’
Parameters
dev_idβ Crypto device identifier.
Returns
- The number of configured queue pairs. that's it that's the tea π΅
int rte_cryptodev_stats_get (uint8_t dev_id, struct rte_cryptodev_stats * stats)
Retrieve the general I/O statistics of a device π like the receipts of everything it's been doing.
Parameters
dev_idβ The identifier of the device.statsβ A pointer to a structure of typerte_cryptodev_statsthat's gonna get filled up with the values of the device counters π
Returns
- Zero if successful π
- Non-zero otherwise π
void rte_cryptodev_stats_reset (uint8_t dev_id)
Reset the general I/O statistics of a device. clean slate era fr fr β¨
Parameters
dev_idβ The identifier of the device.
void rte_cryptodev_info_get (uint8_t dev_id, struct rte_cryptodev_info * dev_info)
Retrieve the contextual information of a device π΅οΈβοΈ the whole backstory, the lore.
Parameters
dev_idβ The identifier of the device.dev_infoβ A pointer to a structure of typerte_cryptodev_infothat's getting filled with the contextual information of the device.
Note π«Ά β thecapabilitiesfield ofdev_infois set to point to the first element of an array ofstruct rte_cryptodev_capabilities. The element after the last valid element has itsopfield set toRTE_CRYPTO_OP_TYPE_UNDEFINED. That's your lil "the list stops here" signal, iykyk π
int rte_cryptodev_callback_register (uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void * cb_arg)
Register a callback function for a specific device id π like "hey ping me when this happens".
Parameters
dev_idβ Device id.eventβ Event interested. πcb_fnβ User supplied callback function to be called.cb_argβ Pointer to the parameters for the registered callback.
Returns
- On success, zero. π
- On failure, a negative value. π
int rte_cryptodev_callback_unregister (uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void * cb_arg)
Unregister a callback function for a specific device id βοΈ we're breaking up w that callback, blocking the number as we speak.
Parameters
dev_idβ The device identifier.eventβ Event interested.cb_fnβ User supplied callback function to be called.cb_argβ Pointer to the parameters for the registered callback.
Returns
- On success, zero. β¨
- On failure, a negative value. π
__rte_experimental int rte_cryptodev_queue_pair_event_error_query (uint8_t dev_id, uint16_t qp_id)
Warning β οΈ β EXPERIMENTAL: this API may change without prior notice. she's still in her testing era, don't get too attached bestie π
Query a cryptodev queue pair if there are pending RTE_CRYPTODEV_EVENT_ERROR events π¨ like a vibe check on whether the qp has any drama pending.
Parameters
dev_idβ The device identifier.qp_idβ Queue pair index to be queried.
Returns
1if requested queue has a pending event π0if no pending event is found π- a negative value on failure π
RTE_TAILQ_HEAD (rte_cryptodev_cb_list , rte_cryptodev_callback )
Structure to keep track of registered callbacks π the master list of everyone on the group chat.
void * rte_cryptodev_get_sec_ctx (uint8_t dev_id)
Get the security context for the cryptodev π
Parameters
dev_idβ The device identifier.
Returns
NULLon error. π- Pointer to security context on success. π
struct rte_mempool * rte_cryptodev_sym_session_pool_create (const char * name, uint32_t nb_elts, uint32_t elt_size, uint32_t cache_size, uint16_t priv_size, int socket_id)
Create a symmetric session mempool π§Ί building the lil basket everything's gonna live in.
Parameters
nameβ The unique mempool name. gotta be one of a kind, main character energy πnb_eltsβ The number of elements in the mempool.elt_sizeβ The size of the element. This should be the size of the cryptodev PMD session private data, which you get through therte_cryptodev_sym_get_private_session_size()function call. Now if you're the kind of user who wants to use the same mempool for heterogeneous PMDs, this value should be the maximum value of their private session sizes. π And pls note: the mempool you create will actually have a bigger elt size than this value, because the necessary session header and possible padding get filled into each elt. so don't be surprised when it's thicc πcache_sizeβ The number of per-lcore cache elements.priv_sizeβ The private data size of each session.socket_idβ Thesocket_idargument is the socket identifier in the case of NUMA. The value can beSOCKET_ID_ANYif there is no NUMA constraint for the reserved zone. π
Returns
- On success returns the created session mempool pointer π
- On failure returns
NULLπ
struct rte_mempool * rte_cryptodev_asym_session_pool_create (const char * name, uint32_t nb_elts, uint32_t cache_size, uint16_t user_data_size, int socket_id)
Create an asymmetric session mempool π§Ίβ¨ the asym cousin of the one above.
Parameters
nameβ The unique mempool name.nb_eltsβ The number of elements in the mempool.cache_sizeβ The number of per-lcore cache elements.user_data_sizeβ The size of user data to be placed after session private data. πsocket_idβ Thesocket_idargument is the socket identifier in the case of NUMA. The value can beSOCKET_ID_ANYif there is no NUMA constraint for the reserved zone. π
Returns
- On success return mempool π
- On failure returns
NULLπ
void * rte_cryptodev_sym_session_create (uint8_t dev_id, struct rte_crypto_sym_xform * xforms, struct rte_mempool * mp)
Create symmetric crypto session and fill out private data for the device id, based on its device type π
Parameters
dev_idβ ID of device that we want the session to be used on.xformsβ Symmetric crypto transform operations to apply on flow processed with this session.mpβ Mempool to allocate symmetric session objects from.
Returns
- On success return pointer to sym-session. β¨
- On failure returns
NULLandrte_errnois set to the error code:EINVALon invalid arguments. πENOMEMon memory error for session allocation. πENOTSUPif device doesn't support session configuration. π«
int rte_cryptodev_asym_session_create (uint8_t dev_id, struct rte_crypto_asym_xform * xforms, struct rte_mempool * mp, void ** session)
Create and initialise an asymmetric crypto session structure. Calls the PMD to configure the private session data π οΈβ¨
Parameters
dev_idβ ID of device that we want the session to be used on.xformsβ Asymmetric crypto transform operations to apply on flow processed with this session.mpβ mempool to allocate asymmetric session objects from.sessionβvoid **for session to be used.
Returns
0on success. π-EINVALon invalid arguments.-ENOMEMon memory error for session allocation.-ENOTSUPif device doesn't support session configuration.
int rte_cryptodev_sym_session_free (uint8_t dev_id, void * sess)
Frees session for the device id and returning it to its mempool π§Ίβ©οΈ Now listen β it is the application's responsibility to ensure that the session is not still in-flight operations using it. like fr fr, if you free a session while something's still using it, that's on you bestie π
Parameters
dev_idβ ID of device that uses the session.sessβ Session header to be freed.
Returns
0if successful. π-EINVALif session isNULLor the mismatched device ids.
int rte_cryptodev_asym_session_free (uint8_t dev_id, void * sess)
Clears and frees asymmetric crypto session header and private data, returning it to its original mempool ποΈβ¨
Parameters
dev_idβ ID of device that uses the asymmetric session.sessβ Session header to be freed.
Returns
0if successful. π-EINVALif device is invalid or session isNULL.
unsigned int rte_cryptodev_asym_get_header_session_size (void )
Get the size of the asymmetric session header π
Returns
Size of the asymmetric header session. that's the number, periodt π
unsigned int rte_cryptodev_sym_get_private_session_size (uint8_t dev_id)
Get the size of the private symmetric session data for a device π
Parameters
dev_idβ The device identifier.
Returns
- Size of the private data, if successful β¨
0if device is invalid or does not have private symmetric session πΆ
unsigned int rte_cryptodev_asym_get_private_session_size (uint8_t dev_id)
Get the size of the private data for asymmetric session on device ππ
Parameters
dev_idβ The device identifier.
Returns
- Size of the asymmetric private data, if successful π
0if device is invalid or does not have private session πΆ
unsigned int rte_cryptodev_is_valid_dev (uint8_t dev_id)
Validate if the crypto device index is valid attached crypto device β vibe check on the device index basically.
Parameters
dev_idβ Crypto device index.
Returns
- If the device index is valid (
1) or not (0). π―
int rte_cryptodev_driver_id_get (const char * name)
Provide driver identifier πͺͺ
Parameters
nameβ The pointer to a driver name.
Returns
The driver type identifier or -1 if no driver found π
const char * rte_cryptodev_driver_name_get (uint8_t driver_id)
Provide driver name π
Parameters
driver_idβ The driver identifier.
Returns
The driver name or null if no driver found π
int rte_cryptodev_sym_session_set_user_data (void * sess, void * data, uint16_t size)
Store user data in a session π¦ tucking your lil extra info in there.
Parameters
sessβ Session pointer allocated byrte_cryptodev_sym_session_create.dataβ Pointer to the user data.sizeβ Size of the user data.
Returns
- On success, zero. β¨
- On failure, a negative value. π
uint64_t rte_cryptodev_sym_session_opaque_data_get (void * sess) [inline], [static]
Get opaque data from session handle πΆοΈ
Definition at line 1310 of file rte_cryptodev.h.
void rte_cryptodev_sym_session_opaque_data_set (void * sess, uint64_t opaque) [inline], [static]
Set opaque data in session handle πΆοΈβ¨
Definition at line 1319 of file rte_cryptodev.h.
void * rte_cryptodev_sym_session_get_user_data (void * sess)
Get user data stored in a session π
Parameters
sessβ Session pointer allocated byrte_cryptodev_sym_session_create.
Returns
- On success return pointer to user data. π
- On failure returns
NULL. π
int rte_cryptodev_asym_session_set_user_data (void * sess, void * data, uint16_t size)
Store user data in an asymmetric session π¦β¨
Parameters
sessβ Session pointer allocated byrte_cryptodev_asym_session_create.dataβ Pointer to the user data.sizeβ Size of the user data.
Returns
- On success, zero. π
-EINVALif the session pointer is invalid. π«-ENOMEMif the available user data size is smaller than thesizeparameter.
π void * rte_cryptodev_asym_session_get_user_data (void * sess)
Get user data stored in an asymmetric session. Thatβs it, bestie, the user data is right there. π«Ά
Parameters
sessβ Session pointer allocated byrte_cryptodev_asym_session_create.
Returns
- On success return pointer to user data.
- On failure returns
NULL.
π¦ uint32_t rte_cryptodev_sym_cpu_crypto_process (uint8_t dev_id, void * sess, union rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec * vec)
Perform actual crypto processing (encrypt/digest or auth/decrypt) on user provided data. Yep, the actual math happens here. π₯
Parameters
dev_idβ The device identifier.sessβ Cryptodev session structureofsβ Start and stop offsets for auth and cipher operationsvecβ Vectorized operation descriptor
Returns
- Returns number of successfully processed packets.
πΈ int rte_cryptodev_get_raw_dp_ctx_size (uint8_t dev_id)
Get the size of the raw data-path context buffer. Size check, iconic. β¨
Parameters
dev_idβ The device identifier.
Returns
- If the device supports raw data-path APIs, return the context size.
- If the device does not support the APIs, return
-1.
π
int rte_cryptodev_session_event_mdata_set (uint8_t dev_id, void * sess, enum rte_crypto_op_type op_type, enum rte_crypto_op_sess_type sess_type, void * ev_mdata, uint16_t size)
Set session event meta data, periodt. π
Parameters
dev_idβ The device identifier.sessβ Crypto or security session.op_typeβ Operation type.sess_typeβ Session type.ev_mdataβ Pointer to the event crypto meta data (aka unionrte_event_crypto_metadata)sizeβ Size ofev_mdata.
Returns
- On success, zero.
- On failure, a negative value.
π§ int rte_cryptodev_configure_raw_dp_ctx (uint8_t dev_id, uint16_t qp_id, struct rte_crypto_raw_dp_ctx * ctx, enum rte_crypto_op_sess_type sess_type, union rte_cryptodev_session_ctx session_ctx, uint8_t is_update)
Configure raw data-path context data. Setting the vibe for raw DP. π
Parameters
dev_idβ The device identifier.qp_idβ The index of the queue pair from which to retrieve processed packets. The value must be in the range[0, nb_queue_pair - 1]previously supplied torte_cryptodev_configure().ctxβ The raw data-path context data.sess_typeβ Session type.session_ctxβ Session context data.is_updateβ Set0if it is to initialize thectx. Set1ifctxis initialized and only to update session context data.
Returns
- On success return
0. - On failure return negative integer.
-EINVALif input parameters are invalid.-ENOTSUPif crypto device does not support raw DP operations with the provided session.
π₯ uint32_t rte_cryptodev_raw_enqueue_burst (struct rte_crypto_raw_dp_ctx * ctx, struct rte_crypto_sym_vec * vec, union rte_crypto_sym_ofs ofs, void ** user_data, int * enqueue_status)
Enqueue a vectorized operation descriptor into the device queue but the driver may or may not start processing until rte_cryptodev_raw_enqueue_done() is called. So donβt assume itβs done done, bestie. π
Parameters
ctxβ The initialized raw data-path context data.vecβ Vectorized operation descriptor.ofsβ Start and stop offsets for auth and cipher operations.user_dataβ The array of user data for dequeue later.enqueue_statusβ Driver written value to specify the enqueue status. Possible values:1: The number of operations returned are enqueued successfully.0: The number of operations returned are cached into the queue but are not processed untilrte_cryptodev_raw_enqueue_done()is called.- negative integer: Error occurred.
Returns
- The number of operations in the descriptor successfully enqueued or cached into the queue but not enqueued yet, depends on the
enqueue_statusvalue.
π¦ __rte_experimental __rte_always_inline int rte_cryptodev_raw_enqueue (struct rte_crypto_raw_dp_ctx * ctx, struct rte_crypto_vec * data_vec, uint16_t n_data_vecs, union rte_crypto_sym_ofs ofs, struct rte_crypto_va_iova_ptr * iv, struct rte_crypto_va_iova_ptr * digest, struct rte_crypto_va_iova_ptr * aad_or_auth_iv, void * user_data) [static]
Enqueue single raw data vector into the device queue but the driver may or may not start processing until rte_cryptodev_raw_enqueue_done() is called. Same energy as above, just one vector. β¨
Parameters
ctxβ The initialized raw data-path context data.data_vecβ The buffer data vector.n_data_vecsβ Number of buffer data vectors.ofsβ Start and stop offsets for auth and cipher operations.ivβ IV virtual and IOVA addressesdigestβ digest virtual and IOVA addressesaad_or_auth_ivβ AAD or auth IV virtual and IOVA addresses, depends on the algorithm used.user_dataβ The user data.
Returns
1: The data vector is enqueued successfully.0: The data vector is cached into the queue but is not processed untilrte_cryptodev_raw_enqueue_done()is called.- negative integer: failure.
Definition at line 1695 of file rte_cryptodev.h.
π int rte_cryptodev_raw_enqueue_done (struct rte_crypto_raw_dp_ctx * ctx, uint32_t n)
Start processing all enqueued operations from last rte_cryptodev_configure_raw_dp_ctx() call. Now we actually go. π
Parameters
ctxβ The initialized raw data-path context data.nβ The number of operations cached.
Returns
- On success return
0. - On failure return negative integer.
π uint32_t rte_cryptodev_raw_dequeue_burst (struct rte_crypto_raw_dp_ctx * ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void ** out_user_data, uint8_t is_user_data_array, uint32_t * n_success, int * dequeue_status)
Dequeue a burst of symmetric crypto processing. Grab the finished ones, bestie. π
Parameters
ctxβ The initialized raw data-path context data.get_dequeue_countβ User provided callback function to obtain dequeue operation count.max_nb_to_dequeueβ Whenget_dequeue_countisNULLthis value is used to pass the maximum number of operations to be dequeued.post_dequeueβ User provided callback function to post-process a dequeued operation.out_user_dataβ User data pointer array to be retrieved from device queue. In case ofis_user_data_arrayis set there should be enough room to store all user data.is_user_data_arrayβ Set1if every dequeued user data will be written intoout_user_dataarray. Set0if only the first user data will be written intoout_user_dataarray.n_successβ Driver written value to specify the total successful operations count.dequeue_statusβ Driver written value to specify the dequeue status. Possible values:1: Successfully dequeued the number of operations returned. The user data previously set during enqueue is stored in theout_user_data.0: The number of operations returned are completed and the user data is stored in theout_user_data, but they are not freed from the queue untilrte_cryptodev_raw_dequeue_done()is called.- negative integer: Error occurred.
Returns
- The number of operations dequeued or completed but not freed from the queue, depends on
dequeue_statusvalue.
π§ __rte_experimental __rte_always_inline void * rte_cryptodev_raw_dequeue (struct rte_crypto_raw_dp_ctx * ctx, int * dequeue_status, enum rte_crypto_op_status * op_status) [static]
Dequeue a symmetric crypto processing. One at a time, iconic. π«Ά
Parameters
ctxβ The initialized raw data-path context data.dequeue_statusβ Driver written value to specify the dequeue status. Possible values:1: Successfully dequeued a operation. The user data is returned.0: The first operation in the queue is completed and the user data previously set during enqueue is returned, but it is not freed from the queue untilrte_cryptodev_raw_dequeue_done()is called.- negative integer: Error occurred.
op_statusβ Driver written value to specify operation status.
Returns
- The user data pointer retrieved from device queue or
NULLif no operation is ready for dequeue.
Definition at line 1795 of file rte_cryptodev.h.
π int rte_cryptodev_raw_dequeue_done (struct rte_crypto_raw_dp_ctx * ctx, uint32_t n)
Inform the queue pair dequeue operations is finished. Cleanup era. β¨
Parameters
ctxβ The initialized raw data-path context data.nβ The number of operations.
Returns
- On success return
0. - On failure return negative integer.
π struct rte_cryptodev_cb * rte_cryptodev_add_enq_callback (uint8_t dev_id, uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void * cb_arg)
Add a user callback for a given crypto device and queue pair which will be called on crypto ops enqueue. Main character callback energy. π
This API configures a function to be called for each burst of crypto ops received on a given crypto device queue pair. The return value is a pointer that can be used later to remove the callback using rte_cryptodev_remove_enq_callback().
Careful, bestie: Callbacks registered by application would not surviverte_cryptodev_configure()as it reinitializes the callback list. It is user responsibility to remove all installed callbacks before callingrte_cryptodev_configure()to avoid possible memory leakage. Application is expected to call add API afterrte_cryptodev_configure().
Multiple functions can be registered per queue pair & they are called in the order they were added. The API does not restrict on maximum number of callbacks.
Parameters
dev_idβ The identifier of the device.qp_idβ The index of the queue pair on which ops are to be enqueued for processing. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.cb_fnβ The callback functioncb_argβ A generic pointer parameter which will be passed to each invocation of the callback function on this crypto device and queue pair.
Returns
NULLon error &rte_errnowill contain the error code.- On success, a pointer value which can later be used to remove the callback.
π int rte_cryptodev_remove_enq_callback (uint8_t dev_id, uint16_t qp_id, struct rte_cryptodev_cb * cb)
Remove a user callback function for given crypto device and queue pair.
This function is used to remove enqueue callbacks that were added to a crypto device queue pair using rte_cryptodev_add_enq_callback().
okay so, finishing up rte_cryptodev_remove_enq_callback() β the params are giving very much "know your queue pair" energy, no cap:
dev_idβ the identifier of the device. πqp_idβ the index of the queue pair on which ops are to be enqueued. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure. π«Άcbβ pointer to user supplied callback created viarte_cryptodev_add_enq_callback(). β¨
Returns
0β Success. Callback was removed. π<0β Thedev_idor theqp_idis out of range, or the callback isNULLor not found for the crypto device queue pair. π
π¦ rte_cryptodev_add_deq_callback() π¦
struct rte_cryptodev_cb * rte_cryptodev_add_deq_callback (uint8_t dev_id,
uint16_t qp_id, rte_cryptodev_callback_fn cb_fn, void * cb_arg)
Add a user callback for a given crypto device and queue pair which will be called on crypto ops dequeue.
This API configures a function to be called for each burst of crypto ops received on a given crypto device queue pair. The return value is a pointer that can be used later to remove the callback using rte_cryptodev_remove_deq_callback(). So yes, bestie, it's giving "save this receipt." π§Ύ
Callbacks registered by application would not surviverte_cryptodev_configure()as it reinitializes the callback list. It is user responsibility to remove all installed callbacks before callingrte_cryptodev_configure()to avoid possible memory leakage. Application is expected to call add API afterrte_cryptodev_configure().
Multiple functions can be registered per queue pair & they are called in the order they were added. The API does not restrict on maximum number of callbacks. π₯
Parameters
dev_idβ The identifier of the device.qp_idβ The index of the queue pair on which ops are to be dequeued. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.cb_fnβ The callback function.cb_argβ A generic pointer parameter which will be passed to each invocation of the callback function on this crypto device and queue pair.
Returns
NULLon error &rte_errnowill contain the error code. π- On success, a pointer value which can later be used to remove the callback. π
πΈ rte_cryptodev_remove_deq_callback() πΈ
int rte_cryptodev_remove_deq_callback (uint8_t dev_id, uint16_t qp_id,
struct rte_cryptodev_cb * cb)
Remove a user callback function for given crypto device and queue pair.
This function is used to remove dequeue callbacks that were added to a crypto device queue pair using rte_cryptodev_add_deq_callback(). Periodt. π
Parameters
dev_idβ The identifier of the device.qp_idβ The index of the queue pair on which ops are to be dequeued. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.cbβ Pointer to user supplied callback created viarte_cryptodev_add_deq_callback().
Returns
0β Success. Callback was removed.<0β Thedev_idor theqp_idis out of range, or the callback isNULLor not found for the crypto device queue pair.
π rte_cryptodev_dequeue_burst() π
uint16_t rte_cryptodev_dequeue_burst (uint8_t dev_id, uint16_t qp_id, struct
rte_crypto_op ** ops, uint16_t nb_ops) [inline], [static]
Dequeue a burst of processed crypto operations from a queue on the crypto device. The dequeued operation are stored in rte_crypto_op structures whose pointers are supplied in the ops array.
The rte_cryptodev_dequeue_burst() function returns the number of ops actually dequeued, which is the number of rte_crypto_op data structures effectively supplied into the ops array.
A return value equal to nb_ops indicates that the queue contained at least nb_ops operations, and this is likely to signify that other processed operations remain in the devices output queue. Applications implementing a "retrieve as many processed operations as possible" policy can check this specific case and keep invoking the rte_cryptodev_dequeue_burst() function until a value less than nb_ops is returned.
The rte_cryptodev_dequeue_burst() function does not provide any error notification to avoid the corresponding overhead. π
Parameters
dev_idβ The symmetric crypto device identifier.qp_idβ The index of the queue pair from which to retrieve processed packets. The value must be in the range[0, nb_queue_pair - 1]previously supplied torte_cryptodev_configure().opsβ The address of an array of pointers torte_crypto_opstructures that must be large enough to storenb_opspointers in it.nb_opsβ The maximum number of operations to dequeue.
Returns
- The number of operations actually dequeued, which is the number of pointers to
rte_crypto_opstructures effectively supplied to theopsarray. π«
π Definition at line 1992 of file rte_cryptodev.h.
π₯ rte_cryptodev_enqueue_burst() π₯
uint16_t rte_cryptodev_enqueue_burst (uint8_t dev_id, uint16_t qp_id, struct
rte_crypto_op ** ops, uint16_t nb_ops) [inline], [static]
Enqueue a burst of operations for processing on a crypto device.
The rte_cryptodev_enqueue_burst() function is invoked to place crypto operations on the queue qp_id of the device designated by its dev_id.
The nb_ops parameter is the number of operations to process which are supplied in the ops array of rte_crypto_op structures.
The rte_cryptodev_enqueue_burst() function returns the number of operations it actually enqueued for processing. A return value equal to nb_ops means that all packets have been enqueued. Slay. π
Parameters
dev_idβ The identifier of the device.qp_idβ The index of the queue pair which packets are to be enqueued for processing. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.opsβ The address of an array ofnb_opspointers torte_crypto_opstructures which contain the crypto operations to be processed.nb_opsβ The number of operations to process.
Returns
- The number of operations actually enqueued on the crypto device. The return value can be less than the value of the
nb_opsparameter when the crypto devices queue is full or if invalid parameters are specified in arte_crypto_op. β οΈ
π Definition at line 2064 of file rte_cryptodev.h.
π rte_cryptodev_qp_depth_used() π
Warning β EXPERIMENTAL: this API may change, or be removed, without prior notice π
__rte_experimental int rte_cryptodev_qp_depth_used (uint8_t dev_id, uint16_t
qp_id) [inline], [static]
Get the number of used descriptors or depth of a cryptodev queue pair.
This function retrieves the number of used descriptors in a crypto queue. Applications can use this API in the fast path to inspect QP occupancy and take appropriate action. Main character fast-path energy, fr fr. β‘
Since it is a fast-path function, no check is performed on dev_id and qp_id. Caller must therefore ensure that the device is enabled and queue pair is setup. π
Parameters
dev_idβ The identifier of the device.qp_idβ The index of the queue pair for which used descriptor count is to be retrieved. The value must be in the range[0, nb_queue_pairs - 1]previously supplied torte_cryptodev_configure.
Returns
- The number of used descriptors on the specified queue pair, or:
(-ENOTSUP)if the device does not support this function. π
π Definition at line 2127 of file rte_cryptodev.h.
π Author π
Generated automatically by Doxygen for DPDK from the source code.
And that's the whole page, bestie. This is DPDK Version 25.11.3, page rte_cryptodev.h(3) β go forth and enqueue/dequeue with main character energy. No cap, you got this. πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms