rte_crypto.h(3)
π NAME π
rte_crypto.h β straight out of the Library Functions Manual, section 3, bestie. It's the crypto header file that holds all the shared, common definitions for DPDK's crypto ops. She's the blueprint. The moment. π«Ά
β¨ SYNOPSIS β¨
Okay so first of all, the includes, and yes you need all of them:
#include <rte_mbuf.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_common.h>
#include 'rte_crypto_sym.h'
#include 'rte_crypto_asym.h'
(not me clocking that the last two use single quotes instead of angle brackets β that's literally what's in the header, so we leave it, periodt π )
π Data Structures π
Two structs, both iconic:
struct rte_crypto_opstruct rte_crypto_op_pool_private
π Macros π
#define RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY (1 << 0)
#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY
RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY
πΈ Enumerations πΈ
enum rte_crypto_op_type { RTE_CRYPTO_OP_TYPE_UNDEFINED, RTE_CRYPTO_OP_TYPE_SYMMETRIC, RTE_CRYPTO_OP_TYPE_ASYMMETRIC }enum rte_crypto_op_status { RTE_CRYPTO_OP_STATUS_SUCCESS, RTE_CRYPTO_OP_STATUS_NOT_PROCESSED, RTE_CRYPTO_OP_STATUS_AUTH_FAILED, RTE_CRYPTO_OP_STATUS_INVALID_SESSION, RTE_CRYPTO_OP_STATUS_INVALID_ARGS, RTE_CRYPTO_OP_STATUS_ERROR }enum rte_crypto_op_sess_type { RTE_CRYPTO_OP_WITH_SESSION, RTE_CRYPTO_OP_SESSIONLESS, RTE_CRYPTO_OP_SECURITY_SESSION }
π¦ Functions π¦
Here's the whole girl squad of function signatures, lowkey the main character list:
static void __rte_crypto_op_reset (struct rte_crypto_op *op, enum rte_crypto_op_type type)
static uint16_t __rte_crypto_op_get_priv_data_size (struct rte_mempool *mempool)
struct rte_mempool * rte_crypto_op_pool_create (const char *name, enum rte_crypto_op_type type, unsigned nb_elts, unsigned cache_size, uint16_t priv_size, int socket_id)
static int __rte_crypto_op_raw_bulk_alloc (struct rte_mempool *mempool, enum rte_crypto_op_type type, struct rte_crypto_op **ops, uint16_t nb_ops)
static struct rte_crypto_op * rte_crypto_op_alloc (struct rte_mempool *mempool, enum rte_crypto_op_type type)
static unsigned rte_crypto_op_bulk_alloc (struct rte_mempool *mempool, enum rte_crypto_op_type type, struct rte_crypto_op **ops, uint16_t nb_ops)
static void * __rte_crypto_op_get_priv_data (struct rte_crypto_op *op, uint32_t size)
static void rte_crypto_op_free (struct rte_crypto_op *op)
static struct rte_crypto_op * rte_crypto_sym_op_alloc_from_mbuf_priv_data (struct rte_mbuf *m)
static struct rte_crypto_sym_xform * rte_crypto_op_sym_xforms_alloc (struct rte_crypto_op *op, uint8_t nb_xforms)
static int rte_crypto_op_attach_sym_session (struct rte_crypto_op *op, void *sess)
static int rte_crypto_op_attach_asym_session (struct rte_crypto_op *op, struct rte_cryptodev_asym_session *sess)
π Detailed Description π
RTE Cryptography Common Definitions π
That's the whole vibe. It's giving "definition in file rte_crypto.h." β literally, that's what the docs say and I'm not gonna gatekeep it.
π Macro Definition Documentation π
#define RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY (1 << 0)
Session soft expiry limit has been reached. Bestie, this applies to any session that has a soft lifetime feature supported. She's the little flag that says "your session is getting old, heads up."
See also π
rte_security_ipsec_lifetimerte_security_tls_record_lifetime
Definition at line 68 of file rte_crypto.h.
#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY
Okay so this one literally just is RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY.
SA soft expiry limit has been reached β that's the tea. Security Association said "I'm tired, boss."
Definition at line 78 of file rte_crypto.h.
π§ Enumeration Type Documentation π§
enum rte_crypto_op_type
Crypto operation types β pick your fighter:
RTE_CRYPTO_OP_TYPE_UNDEFINEDβ Undefined operation type (the "figure it out later" option)RTE_CRYPTO_OP_TYPE_SYMMETRICβ Symmetric operationRTE_CRYPTO_OP_TYPE_ASYMMETRICβ Asymmetric operation
Definition at line 28 of file rte_crypto.h.
enum rte_crypto_op_status
Status of crypto operation β the mood ring of your op:
RTE_CRYPTO_OP_STATUS_SUCCESSβ Operation completed successfully πRTE_CRYPTO_OP_STATUS_NOT_PROCESSEDβ Operation has not yet been processed by a crypto device (she's waiting her turn, patient queen)RTE_CRYPTO_OP_STATUS_AUTH_FAILEDβ Authentication verification failed πRTE_CRYPTO_OP_STATUS_INVALID_SESSIONβ Symmetric operation failed due to invalid session arguments, or, if in session-less mode, failed to allocate private operation material. πRTE_CRYPTO_OP_STATUS_INVALID_ARGSβ Operation failed due to invalid arguments in requestRTE_CRYPTO_OP_STATUS_ERRORβ Error handling operation
Definition at line 38 of file rte_crypto.h.
enum rte_crypto_op_sess_type
Crypto operation session type. So this is used to specify whether a crypto operation has a session structure attached for immutable parameters, or if all the operation information is included in the operation data structure. Basically: does she carry a session, or is she self-contained? π
RTE_CRYPTO_OP_WITH_SESSIONβ Session based crypto operationRTE_CRYPTO_OP_SESSIONLESSβ Session-less crypto operationRTE_CRYPTO_OP_SECURITY_SESSIONβ Security session crypto operation
Definition at line 61 of file rte_crypto.h.
π₯ Function Documentation π₯
__rte_crypto_op_reset
void __rte_crypto_op_reset (struct rte_crypto_op * op, enum rte_crypto_op_type type)
This one's [inline], [static] β header-file lifestyle.
Reset the fields of a crypto operation to their default values. Factory reset, but for an op. β¨
Parameters
opβ The crypto operation to be reset.typeβ The crypto operation type.
Definition at line 196 of file rte_crypto.h.
__rte_crypto_op_get_priv_data_size
uint16_t __rte_crypto_op_get_priv_data_size (struct rte_mempool * mempool)
[inline], [static], obvi.
Returns the size of private data allocated with each rte_crypto_op object by the mempool. Measuring tape behavior. π
Parameters
mempoolβrte_crypto_opmempool
Returns
- private data size
Definition at line 235 of file rte_crypto.h.
rte_crypto_op_pool_create
struct rte_mempool * rte_crypto_op_pool_create (const char * name, enum rte_crypto_op_type type, unsigned nb_elts, unsigned cache_size, uint16_t priv_size, int socket_id)
Creates a crypto operation pool β the whole friend group, allocated up front. π«Ά
Parameters
nameβ pool nametypeβ crypto operation type, useRTE_CRYPTO_OP_TYPE_UNDEFINEDfor a pool which supports all operation typesnb_eltsβ number of elements in poolcache_sizeβ Number of elements to cache on lcore, seerte_mempool_createfor further details about cache sizepriv_sizeβ Size of private data to allocate with each operationsocket_idβ Socket to allocate memory on
Returns
- π On success pointer to mempool
- π On failure
NULL
__rte_crypto_op_raw_bulk_alloc
int __rte_crypto_op_raw_bulk_alloc (struct rte_mempool * mempool, enum rte_crypto_op_type type, struct rte_crypto_op ** ops, uint16_t nb_ops)
[inline], [static].
Bulk allocate raw element from mempool and return as crypto operations. Wholesale, no individual attention, and honestly? Efficient. π
Parameters
mempoolβ crypto operation mempool.typeβ crypto operation type.opsβ Array to place allocated crypto operationsnb_opsβ Number of crypto operations to allocate
Returns
- On success returns number of ops allocated
Definition at line 280 of file rte_crypto.h.
rte_crypto_op_alloc
struct rte_crypto_op * rte_crypto_op_alloc (struct rte_mempool * mempool, enum rte_crypto_op_type type)
[inline], [static].
Allocate a crypto operation from a mempool with default parameters set. One (1) op, freshly picked. πΈ
Parameters
mempoolβ crypto operation mempooltypeβ operation type to allocate
Returns
- β¨ On success returns a valid
rte_crypto_opstructure - π On failure returns
NULL
Definition at line 308 of file rte_crypto.h.
rte_crypto_op_bulk_alloc
unsigned rte_crypto_op_bulk_alloc (struct rte_mempool * mempool, enum rte_crypto_op_type type, struct rte_crypto_op ** ops, uint16_t nb_ops)
[inline], [static].
Bulk allocate crypto operations from a mempool with default parameters set. It's giving "bring the whole group chat." π
Parameters
mempoolβ crypto operation mempooltypeβ operation type to allocateopsβ Array to place allocated crypto operationsnb_opsβ Number of crypto operations to allocate
Returns
nb_opsif the number of operations requested were allocated.0if the requested number of ops are not available. None are allocated in this case. (all or nothing, no crumbs π)
Definition at line 338 of file rte_crypto.h.
__rte_crypto_op_get_priv_data
void * __rte_crypto_op_get_priv_data (struct rte_crypto_op * op, uint32_t size)
[inline], [static].
Returns a pointer to the private data of a crypto operation if that operation has enough capacity for the requested size. Vibe check included. π¦
Parameters
opβ crypto operation.sizeβ size of space requested in private data.
Returns
- if sufficient space available returns pointer to start of private data
- if insufficient space returns
NULL
Definition at line 368 of file rte_crypto.h.
rte_crypto_op_free
void rte_crypto_op_free (struct rte_crypto_op * op)
[inline], [static].
free crypto operation structure β If operation has been allocate from a rte_mempool, then the operation will be returned to the mempool. Rehoming arc. β»οΈ
Parameters
opβ Pointer to symmetric crypto operation allocated withrte_crypto_op_alloc()IfopisNULL, no operation is performed. (noNULLslander here, she just minds her business)
Definition at line 398 of file rte_crypto.h.
rte_crypto_sym_op_alloc_from_mbuf_priv_data
struct rte_crypto_op * rte_crypto_sym_op_alloc_from_mbuf_priv_data (struct rte_mbuf * m)
[inline], [static].
Allocate a symmetric crypto operation in the private data of an mbuf. She literally lives inside her mbuf, that's so main character. π§
Parameters
mβ mbuf which is associated with the crypto operation, the operation will be allocated in the private data of that mbuf.
Returns
- π On success returns a pointer to the crypto operation.
- π On failure returns
NULL.
Definition at line 416 of file rte_crypto.h.
rte_crypto_op_sym_xforms_alloc
struct rte_crypto_sym_xform * rte_crypto_op_sym_xforms_alloc (struct rte_crypto_op * op, uint8_t nb_xforms)
[inline], [static].
Allocate space for symmetric crypto xforms in the private data space of the crypto operation. This also defaults the crypto xform type and configures the chaining of the xforms in the crypto operation. She sets up the whole chain reaction, no notes. π
Returns
- On success returns pointer to first crypto xform in crypto operations chain
- On failure returns
NULL
Definition at line 450 of file rte_crypto.h.
rte_crypto_op_attach_sym_session
int rte_crypto_op_attach_sym_session (struct rte_crypto_op * op, void * sess)
[inline], [static].
Attach a session to a crypto operation. Getting official. π
Parameters
opβ crypto operation, must be of type symmetricsessβ cryptodev session
Definition at line 476 of file rte_crypto.h.
rte_crypto_op_attach_asym_session
int rte_crypto_op_attach_asym_session (struct rte_crypto_op * op, struct rte_cryptodev_asym_session * sess)
[inline], [static].
Attach a asymmetric session to a crypto operation. Same ritual, different type. π«Ά
Parameters
opβ crypto operation, must be of type asymmetricsessβ cryptodev session
Definition at line 493 of file rte_crypto.h.
π Author π
Generated automatically by Doxygen for DPDK from the source code. So technically a robot wrote this, and technically I'm just translating it for the girlies. π
okay that's the whole page bestie, no skips, no cap, every flag and line number preserved, and if you made it to the end you get certified-unix-girlfriend status ππ
this little love letter to crypto ops comes to you from DPDK, Version 25.11.3 β mwah, take care of her ππβ¨
π¦ 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