Sponsor:

Your company here, and a link to your site. Click to find out more.

rte_crypto.h - Man Page

Synopsis

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

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

#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 68 of file rte_crypto.h.

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

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.

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.

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

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.

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.

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.

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.

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

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.

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.

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.

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.

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.

Referenced By

The man pages rte_crypto_op_alloc(3), rte_crypto_op_attach_asym_session(3), rte_crypto_op_attach_sym_session(3), RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY(3), RTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY(3), rte_crypto_op_bulk_alloc(3), rte_crypto_op_free(3), __rte_crypto_op_get_priv_data(3), __rte_crypto_op_get_priv_data_size(3), rte_crypto_op_pool_create(3), __rte_crypto_op_raw_bulk_alloc(3), __rte_crypto_op_reset(3), RTE_CRYPTO_OP_SECURITY_SESSION(3), RTE_CRYPTO_OP_SESSIONLESS(3), rte_crypto_op_sess_type(3), rte_crypto_op_status(3), RTE_CRYPTO_OP_STATUS_AUTH_FAILED(3), RTE_CRYPTO_OP_STATUS_ERROR(3), RTE_CRYPTO_OP_STATUS_INVALID_ARGS(3), RTE_CRYPTO_OP_STATUS_INVALID_SESSION(3), RTE_CRYPTO_OP_STATUS_NOT_PROCESSED(3), RTE_CRYPTO_OP_STATUS_SUCCESS(3), rte_crypto_op_sym_xforms_alloc(3), rte_crypto_op_type(3), RTE_CRYPTO_OP_TYPE_ASYMMETRIC(3), RTE_CRYPTO_OP_TYPE_SYMMETRIC(3), RTE_CRYPTO_OP_TYPE_UNDEFINED(3), RTE_CRYPTO_OP_WITH_SESSION(3) and rte_crypto_sym_op_alloc_from_mbuf_priv_data(3) are aliases of rte_crypto.h(3).

Version 23.11.0 DPDK