rte_crypto.h(3)

✨ rte_crypto.h β€” DPDK's common crypto definitions, bestie ✨

πŸ’– NAME πŸ’–

rte_crypto.h β€” the common crypto header for DPDK crypto operations. Short name section, iconic behavior. πŸ’…

✨ SYNOPSIS ✨

Okay so you include these headers, and yes the last two use single quotes exactly like the page says:

#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'

🧸 Data Structures

  • struct rte_crypto_op
  • struct rte_crypto_op_pool_private

πŸŽ€ Macros

  • #define RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY (1 << 0) β€” session soft expiry limit has been reached. Applicable for any session that has a soft lifetime feature supported.
  • #define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY β€” RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY; SA soft expiry limit has been reached.

πŸ¦‹ 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

All the function signatures, copied exactly with their inline/static energy:

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

Definition in file rte_crypto.h.

πŸ’… Macro Definition Documentation πŸ’…

RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY

#define RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY   (1 << 0)

Session soft expiry limit has been reached. Applicable for any session that has a soft lifetime feature supported.

See also: rte_security_ipsec_lifetime, rte_security_tls_record_lifetime

Definition at line 74 of file rte_crypto.h.

RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY

#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY
    RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY

SA soft expiry limit has been reached

Definition at line 79 of file rte_crypto.h.

🌈 Enumeration Type Documentation 🌈

enum rte_crypto_op_type

Crypto operation types

Enumerator

  • RTE_CRYPTO_OP_TYPE_UNDEFINED β€” undefined operation type
  • RTE_CRYPTO_OP_TYPE_SYMMETRIC β€” symmetric operation
  • RTE_CRYPTO_OP_TYPE_ASYMMETRIC β€” asymmetric operation

Definition at line 28 of file rte_crypto.h.

enum rte_crypto_op_status

Status of crypto operation

Enumerator

  • RTE_CRYPTO_OP_STATUS_SUCCESS β€” operation completed successfully
  • RTE_CRYPTO_OP_STATUS_NOT_PROCESSED β€” operation has not yet been processed by a crypto device
  • 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 request
  • RTE_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. This is used to specify whether a crypto operation has session structure attached for immutable parameters or if all operation information is included in the operation data structure.

Enumerator

  • RTE_CRYPTO_OP_WITH_SESSION β€” session based crypto operation
  • RTE_CRYPTO_OP_SESSIONLESS β€” session-less crypto operation
  • RTE_CRYPTO_OP_SECURITY_SESSION β€” security session crypto operation

Definition at line 61 of file rte_crypto.h.

⭐ Function Documentation ⭐

__rte_crypto_op_reset β€” reset the fields, keep the facts

static void __rte_crypto_op_reset (struct rte_crypto_op * op, enum
    rte_crypto_op_type type) [inline],  [static]

Reset the fields of a crypto operation to their default values.

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 β€” size check, but make it cute

static uint16_t __rte_crypto_op_get_priv_data_size (struct rte_mempool *
    mempool) [inline],  [static]

Returns the size of private data allocated with each rte_crypto_op object by the mempool.

Parameters:

  • mempool β€” rte_crypto_op mempool.

Returns:

  • private data size

Definition at line 235 of file rte_crypto.h.

rte_crypto_op_pool_create β€” make a pool, hydrate, repeat

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.

Parameters:

  • name β€” pool name
  • type β€” crypto operation type, use RTE_CRYPTO_OP_TYPE_UNDEFINED for a pool which supports all operation types
  • nb_elts β€” number of elements in pool
  • cache_size β€” number of elements to cache on lcore, see rte_mempool_create for further details about cache size
  • priv_size β€” size of private data to allocate with each operation
  • socket_id β€” socket to allocate memory on

Returns:

  • On success pointer to mempool
  • On failure NULL

__rte_crypto_op_raw_bulk_alloc β€” raw bulk allocation, no cap

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) [inline],  [static]

Bulk allocate raw element from mempool and return as crypto operations.

Parameters:

  • mempool β€” crypto operation mempool.
  • type β€” crypto operation type.
  • ops β€” array to place allocated crypto operations
  • nb_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 β€” one op, pls

static 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.

Parameters:

  • mempool β€” crypto operation mempool
  • type β€” operation type to allocate

Returns:

  • On success returns a valid rte_crypto_op structure
  • On failure returns NULL

Definition at line 308 of file rte_crypto.h.

rte_crypto_op_bulk_alloc β€” group chat allocation

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)
    [inline],  [static]

Bulk allocate crypto operations from a mempool with default parameters set.

Parameters:

  • mempool β€” crypto operation mempool
  • type β€” operation type to allocate
  • ops β€” array to place allocated crypto operations
  • nb_ops β€” number of crypto operations to allocate

Returns:

  • nb_ops if the number of operations requested were allocated.
  • 0 if the requested number of ops are not available. None are allocated in this case.

Definition at line 338 of file rte_crypto.h.

__rte_crypto_op_get_priv_data β€” access the private data, respectfully

static 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 requested size.

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 β€” release the op back to the pool

static void rte_crypto_op_free (struct rte_crypto_op * op) [inline],
    [static]

Free crypto operation structure. If operation has been allocated from a rte_mempool, then the operation will be returned to the mempool.

Parameters:

  • op β€” pointer to symmetric crypto operation allocated with rte_crypto_op_alloc(). If op is NULL, no operation is performed.

Definition at line 398 of file rte_crypto.h.

rte_crypto_sym_op_alloc_from_mbuf_priv_data β€” op hiding in an mbuf's private data

static 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.

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 β€” xform chain, assembled

static 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.

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 β€” attach that symmetric session

static int rte_crypto_op_attach_sym_session (struct rte_crypto_op * op, void
    * sess) [inline],  [static]

Attach a session to a crypto operation.

Parameters:

  • op β€” crypto operation, must be of type symmetric
  • sess β€” cryptodev session

Definition at line 476 of file rte_crypto.h.

rte_crypto_op_attach_asym_session β€” attach that asymmetric session

static 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.

Parameters:

  • op β€” crypto operation, must be of type asymmetric
  • sess β€” cryptodev session

Definition at line 493 of file rte_crypto.h.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for DPDK from the source code.


That's the whole page, bestie β€” facts intact, vibe immaculate. Footer tea: Version 25.11.0, dated Fri Jan 30 2026, for rte_crypto.h(3) from DPDK. Mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from