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_range
  • struct rte_cryptodev_symmetric_capability
  • struct rte_cryptodev_asymmetric_xform_capability
  • struct rte_cryptodev_asymmetric_capability
  • struct rte_cryptodev_capabilities
  • struct rte_cryptodev_sym_capability_idx
  • struct rte_cryptodev_asym_capability_idx
  • struct rte_cryptodev_info
  • struct rte_cryptodev_qp_conf
  • struct rte_cryptodev_stats
  • struct rte_cryptodev_config
  • struct rte_cryptodev_cb
  • union rte_cryptodev_session_ctx
  • struct 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 as RTE_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 bit
  • RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO β€” (1ULL << 1) β€” the asymmetric crypto feature bit
  • RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING β€” (1ULL << 2) β€” the symmetric operation chaining feature bit
  • RTE_CRYPTODEV_FF_CPU_SSE β€” (1ULL << 3) β€” the CPU SSE feature bit
  • RTE_CRYPTODEV_FF_CPU_AVX β€” (1ULL << 4) β€” the CPU AVX feature bit
  • RTE_CRYPTODEV_FF_CPU_AVX2 β€” (1ULL << 5) β€” the CPU AVX2 feature bit
  • RTE_CRYPTODEV_FF_CPU_AESNI β€” (1ULL << 6) β€” the CPU AESNI feature bit
  • RTE_CRYPTODEV_FF_HW_ACCELERATED β€” (1ULL << 7) β€” the HW accelerated feature bit
  • RTE_CRYPTODEV_FF_CPU_AVX512 β€” (1ULL << 8) β€” the CPU AVX512 feature bit
  • RTE_CRYPTODEV_FF_IN_PLACE_SGL β€” (1ULL << 9) β€” the in-place SGL feature bit
  • RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT β€” (1ULL << 10) β€” the out-of-place SGL-in / SGL-out feature bit
  • RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT β€” (1ULL << 11) β€” the out-of-place SGL-in / LB-out feature bit
  • RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT β€” (1ULL << 12) β€” the out-of-place LB-in / SGL-out feature bit
  • RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT β€” (1ULL << 13) β€” the out-of-place LB-in / LB-out feature bit
  • RTE_CRYPTODEV_FF_CPU_NEON β€” (1ULL << 14) β€” the CPU NEON feature bit
  • RTE_CRYPTODEV_FF_CPU_ARM_CE β€” (1ULL << 15) β€” the CPU ARM CE feature bit
  • RTE_CRYPTODEV_FF_SECURITY β€” (1ULL << 16) β€” the security feature bit
  • RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP β€” (1ULL << 17) β€” the RSA private-op key-exp feature bit
  • RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT β€” (1ULL << 18) β€” the RSA private-op key-QT feature bit
  • RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED β€” (1ULL << 19) β€” the digest-encrypted feature bit
  • RTE_CRYPTODEV_FF_ASYM_SESSIONLESS β€” (1ULL << 20) β€” the asym sessionless feature bit
  • RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO β€” (1ULL << 21) β€” the sym CPU crypto feature bit
  • RTE_CRYPTODEV_FF_SYM_SESSIONLESS β€” (1ULL << 22) β€” the sym sessionless feature bit
  • RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA β€” (1ULL << 23) β€” the non-byte-aligned data feature bit
  • RTE_CRYPTODEV_FF_SYM_RAW_DP β€” (1ULL << 24) β€” the sym raw data-path feature bit
  • RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS β€” (1ULL << 25) β€” the cipher-multiple-data-units feature bit
  • RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY β€” (1ULL << 26) β€” the cipher wrapped key feature bit
  • RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM β€” (1ULL << 27) β€” the security inner checksum feature bit
  • RTE_CRYPTODEV_FF_SECURITY_RX_INJECT β€” (1ULL << 28) β€” the security RX inject feature bit
  • RTE_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 β€” 0
  • RTE_CRYPTODEV_QP_PRIORITY_NORMAL β€” 128
  • RTE_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_UNKNOWN
  • RTE_CRYPTODEV_EVENT_ERROR
  • RTE_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 file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1) β€” asymmetric crypto operations are supported. ✨ Definition at line 522 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2) β€” chaining symmetric crypto operations is supported. πŸ”— Definition at line 524 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3) β€” utilises CPU SIMD SSE instructions. πŸ–₯️ Definition at line 526 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4) β€” utilises CPU SIMD AVX instructions. πŸ–₯️ Definition at line 528 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5) β€” utilises CPU SIMD AVX2 instructions. πŸ–₯️ Definition at line 530 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6) β€” utilises CPU AES-NI instructions. πŸ” Definition at line 532 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7) β€” operations are off-loaded to an external hardware accelerator. πŸš€ Definition at line 534 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8) β€” utilises CPU SIMD AVX512 instructions. πŸ–₯️ Definition at line 538 of file rte_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 file rte_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 file rte_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 file rte_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 file rte_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 file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14) β€” utilises CPU NEON instructions. πŸ–₯️ Definition at line 559 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15) β€” utilises ARM CPU Cryptographic Extensions. πŸ” Definition at line 561 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SECURITY (1ULL << 16) β€” support Security Protocol Processing. πŸ›‘οΈ Definition at line 563 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP (1ULL << 17) β€” support RSA Private Key OP with exponent. πŸ”‘ Definition at line 565 of file rte_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 file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19) β€” support encrypted-digest operations where digest is appended to data. πŸ’œ Definition at line 569 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20) β€” support asymmetric session-less operations. πŸŽ€ Definition at line 571 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO (1ULL << 21) β€” support symmetric cpu-crypto processing. πŸŽ€ Definition at line 573 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SYM_SESSIONLESS (1ULL << 22) β€” support symmetric session-less operations. πŸŽ€ Definition at line 575 of file rte_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 file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SYM_RAW_DP (1ULL << 24) β€” support accelerator specific symmetric raw data-path APIs. πŸ”₯ Definition at line 579 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS (1ULL << 25) β€” support operations on multiple data-units message. πŸ“ Definition at line 581 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26) β€” support wrapped key in cipher xform. 🎁 Definition at line 583 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM (1ULL << 27) β€” support inner checksum computation/verification. βœ… Definition at line 585 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_SECURITY_RX_INJECT (1ULL << 28) β€” support Rx injection after security processing. πŸ’‰ Definition at line 587 of file rte_cryptodev.h.
  • RTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASH (1ULL << 29) β€” support Pre Hash ML-DSA Signature Generation. ✍️ Definition at line 589 of file rte_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 file rte_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 file rte_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 file rte_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 to rte_cryptodev_configure.
  • ops β€” the address of an array of nb_ops pointers to rte_crypto_op structures 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 identifier
  • event β€” 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 until rte_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_status value.
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 addresses
  • digest β€” digest virtual and IOVA addresses
  • aad_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 until rte_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 β€” When get_dequeue_count is NULL this 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 of is_user_data_array is set there should be enough room to store all user data.
  • is_user_data_array β€” Set 1 if every dequeued user data will be written into out_user_data array. Set 0 if only the first user data will be written into out_user_data array.
  • 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 the out_user_data.
    • 0: The number of operations returned are completed and the user data is stored in the out_user_data, but they are not freed from the queue until rte_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_status value.
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 until rte_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 NULL if 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 type
  • RTE_CRYPTODEV_EVENT_ERROR β€” error interrupt event
  • RTE_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 NULL if 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 NULL if 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 0 if the parameters are in range of the capability.
  • Return -1 if 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 0 if the parameters are in range of the capability.
  • Return -1 if 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

  • 0 if the parameters are in range of the capability. slay ✨
  • -1 if 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

  • 1 if the op type is supported πŸ‘‘
  • 0 if 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

  • 0 if the parameters are in range of the capability. ✨
  • -1 if 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

  • true if the hash algorithm is supported 🫢
  • false if 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

  • 1 if the op capability is supported πŸ‘‘
  • 0 if 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

  • -1 if string is not valid
  • 0 if 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

  • -1 if string is not valid
  • 0 if 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

  • -1 if string is not valid
  • 0 if 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

  • -1 if string is not valid
  • 0 if 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

  • NULL if enum is not valid
  • algo_string corresponding 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

  • NULL if enum is not valid
  • algo_string corresponding 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

  • NULL if enum is not valid
  • algo_string corresponding 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 -1 on 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 NULL if 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

  • 0 on successfully closing device
  • <0 on 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 to rte_cryptodev_configure().
  • qp_conf β€” the pointer to the configuration data to be used for the queue pair.
  • socket_id β€” the socket_id argument is the socket identifier in case of NUMA. The value can be SOCKET_ID_ANY if 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 to rte_cryptodev_configure().
  • qp_conf β€” the pointer to configuration data to be used for the queue pair. It should be NULL, if the API is called from an interrupt context.
  • socket_id β€” the socket_id argument is the socket identifier in case of NUMA. The value can be SOCKET_ID_ANY if 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 that nb_queue_pair is the one you already handed to rte_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 type rte_cryptodev_stats that'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 type rte_cryptodev_info that's getting filled with the contextual information of the device.
Note 🫢 β€” the capabilities field of dev_info is set to point to the first element of an array of struct rte_cryptodev_capabilities. The element after the last valid element has its op field set to RTE_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

  • 1 if requested queue has a pending event πŸ‘€
  • 0 if 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

  • NULL on 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 the rte_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 β€” The socket_id argument is the socket identifier in the case of NUMA. The value can be SOCKET_ID_ANY if 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 β€” The socket_id argument is the socket identifier in the case of NUMA. The value can be SOCKET_ID_ANY if 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 NULL and rte_errno is set to the error code:
    • EINVAL on invalid arguments. πŸ™ˆ
    • ENOMEM on memory error for session allocation. πŸ’€
    • ENOTSUP if 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

  • 0 on success. πŸŽ‰
  • -EINVAL on invalid arguments.
  • -ENOMEM on memory error for session allocation.
  • -ENOTSUP if 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

  • 0 if successful. πŸ’…
  • -EINVAL if session is NULL or 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

  • 0 if successful. πŸŽ€
  • -EINVAL if device is invalid or session is NULL.

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 ✨
  • 0 if 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 πŸ’–
  • 0 if 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 by rte_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 by rte_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 by rte_cryptodev_asym_session_create.
  • data β€” Pointer to the user data.
  • size β€” Size of the user data.

Returns

  • On success, zero. πŸŽ€
  • -EINVAL if the session pointer is invalid. 🚫
  • -ENOMEM if the available user data size is smaller than the size parameter.

πŸ’– 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 by rte_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 structure
  • ofs β€” Start and stop offsets for auth and cipher operations
  • vec β€” 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 union rte_event_crypto_metadata)
  • size β€” Size of ev_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 to rte_cryptodev_configure().
  • ctx β€” The raw data-path context data.
  • sess_type β€” Session type.
  • session_ctx β€” Session context data.
  • is_update β€” Set 0 if it is to initialize the ctx. Set 1 if ctx is initialized and only to update session context data.

Returns

  • On success return 0.
  • On failure return negative integer.
    • -EINVAL if input parameters are invalid.
    • -ENOTSUP if 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 until rte_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_status value.

πŸ¦‹ __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 addresses
  • digest β€” digest virtual and IOVA addresses
  • aad_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 until rte_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 β€” When get_dequeue_count is NULL this 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 of is_user_data_array is set there should be enough room to store all user data.
  • is_user_data_array β€” Set 1 if every dequeued user data will be written into out_user_data array. Set 0 if only the first user data will be written into out_user_data array.
  • 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 the out_user_data.
    • 0: The number of operations returned are completed and the user data is stored in the out_user_data, but they are not freed from the queue until rte_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_status value.

🧚 __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 until rte_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 NULL if 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 survive rte_cryptodev_configure() as it reinitializes the callback list. It is user responsibility to remove all installed callbacks before calling rte_cryptodev_configure() to avoid possible memory leakage. Application is expected to call add API after rte_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 to rte_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

  • NULL on error & rte_errno will 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 to rte_cryptodev_configure. 🫢
  • cb β€” pointer to user supplied callback created via rte_cryptodev_add_enq_callback(). ✨

Returns

  • 0 β€” Success. Callback was removed. πŸ‘‘
  • <0 β€” The dev_id or the qp_id is out of range, or the callback is NULL or 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 survive rte_cryptodev_configure() as it reinitializes the callback list. It is user responsibility to remove all installed callbacks before calling rte_cryptodev_configure() to avoid possible memory leakage. Application is expected to call add API after rte_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 to rte_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

  • NULL on error & rte_errno will 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 to rte_cryptodev_configure.
  • cb β€” Pointer to user supplied callback created via rte_cryptodev_add_deq_callback().

Returns

  • 0 β€” Success. Callback was removed.
  • <0 β€” The dev_id or the qp_id is out of range, or the callback is NULL or 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 to rte_cryptodev_configure().
  • ops β€” The address of an array of pointers to rte_crypto_op structures that must be large enough to store nb_ops pointers 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_op structures effectively supplied to the ops array. πŸ’«

πŸ“ 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 to rte_cryptodev_configure.
  • ops β€” The address of an array of nb_ops pointers to rte_crypto_op structures 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_ops parameter when the crypto devices queue is full or if invalid parameters are specified in a rte_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 to rte_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