.TH "rte_crypto.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_crypto.h
.SH SYNOPSIS
.br
.PP
\fR#include <rte_mbuf\&.h>\fP
.br
\fR#include <rte_memory\&.h>\fP
.br
\fR#include <rte_mempool\&.h>\fP
.br
\fR#include <rte_common\&.h>\fP
.br
\fR#include 'rte_crypto_sym\&.h'\fP
.br
\fR#include 'rte_crypto_asym\&.h'\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_crypto_op\fP"
.br
.ti -1c
.RI "struct \fBrte_crypto_op_pool_private\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY\fP   (1 << 0)"
.br
.ti -1c
.RI "#define \fBRTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY\fP   \fBRTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY\fP"
.br
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBrte_crypto_op_type\fP { \fBRTE_CRYPTO_OP_TYPE_UNDEFINED\fP, \fBRTE_CRYPTO_OP_TYPE_SYMMETRIC\fP, \fBRTE_CRYPTO_OP_TYPE_ASYMMETRIC\fP }"
.br
.ti -1c
.RI "enum \fBrte_crypto_op_status\fP { \fBRTE_CRYPTO_OP_STATUS_SUCCESS\fP, \fBRTE_CRYPTO_OP_STATUS_NOT_PROCESSED\fP, \fBRTE_CRYPTO_OP_STATUS_AUTH_FAILED\fP, \fBRTE_CRYPTO_OP_STATUS_INVALID_SESSION\fP, \fBRTE_CRYPTO_OP_STATUS_INVALID_ARGS\fP, \fBRTE_CRYPTO_OP_STATUS_ERROR\fP }"
.br
.ti -1c
.RI "enum \fBrte_crypto_op_sess_type\fP { \fBRTE_CRYPTO_OP_WITH_SESSION\fP, \fBRTE_CRYPTO_OP_SESSIONLESS\fP, \fBRTE_CRYPTO_OP_SECURITY_SESSION\fP }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "static void \fB__rte_crypto_op_reset\fP (struct \fBrte_crypto_op\fP *op, enum \fBrte_crypto_op_type\fP type)"
.br
.ti -1c
.RI "static uint16_t \fB__rte_crypto_op_get_priv_data_size\fP (struct \fBrte_mempool\fP *mempool)"
.br
.ti -1c
.RI "struct \fBrte_mempool\fP * \fBrte_crypto_op_pool_create\fP (const char *name, enum \fBrte_crypto_op_type\fP type, unsigned nb_elts, unsigned cache_size, uint16_t priv_size, int socket_id)"
.br
.ti -1c
.RI "static int \fB__rte_crypto_op_raw_bulk_alloc\fP (struct \fBrte_mempool\fP *mempool, enum \fBrte_crypto_op_type\fP type, struct \fBrte_crypto_op\fP **ops, uint16_t nb_ops)"
.br
.ti -1c
.RI "static struct \fBrte_crypto_op\fP * \fBrte_crypto_op_alloc\fP (struct \fBrte_mempool\fP *mempool, enum \fBrte_crypto_op_type\fP type)"
.br
.ti -1c
.RI "static unsigned \fBrte_crypto_op_bulk_alloc\fP (struct \fBrte_mempool\fP *mempool, enum \fBrte_crypto_op_type\fP type, struct \fBrte_crypto_op\fP **ops, uint16_t nb_ops)"
.br
.ti -1c
.RI "static void * \fB__rte_crypto_op_get_priv_data\fP (struct \fBrte_crypto_op\fP *op, uint32_t size)"
.br
.ti -1c
.RI "static void \fBrte_crypto_op_free\fP (struct \fBrte_crypto_op\fP *op)"
.br
.ti -1c
.RI "static struct \fBrte_crypto_op\fP * \fBrte_crypto_sym_op_alloc_from_mbuf_priv_data\fP (struct \fBrte_mbuf\fP *m)"
.br
.ti -1c
.RI "static struct \fBrte_crypto_sym_xform\fP * \fBrte_crypto_op_sym_xforms_alloc\fP (struct \fBrte_crypto_op\fP *op, uint8_t nb_xforms)"
.br
.ti -1c
.RI "static int \fBrte_crypto_op_attach_sym_session\fP (struct \fBrte_crypto_op\fP *op, void *sess)"
.br
.ti -1c
.RI "static int \fBrte_crypto_op_attach_asym_session\fP (struct \fBrte_crypto_op\fP *op, struct rte_cryptodev_asym_session *sess)"
.br
.in -1c
.SH "Detailed Description"
.PP 
RTE Cryptography Common Definitions 
.PP
Definition in file \fBrte_crypto\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#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\&.

.PP
\fBSee also\fP
.RS 4
\fBrte_security_ipsec_lifetime\fP 

.PP
\fBrte_security_tls_record_lifetime\fP 
.RE
.PP

.PP
Definition at line \fB68\fP of file \fBrte_crypto\&.h\fP\&.
.SS "#define RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY   \fBRTE_CRYPTO_OP_AUX_FLAGS_SESS_SOFT_EXPIRY\fP"
SA soft expiry limit has been reached 
.PP
Definition at line \fB78\fP of file \fBrte_crypto\&.h\fP\&.
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBrte_crypto_op_type\fP"
Crypto operation types 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_CRYPTO_OP_TYPE_UNDEFINED \fP
Undefined operation type 
.TP
\f(BIRTE_CRYPTO_OP_TYPE_SYMMETRIC \fP
Symmetric operation 
.TP
\f(BIRTE_CRYPTO_OP_TYPE_ASYMMETRIC \fP
Asymmetric operation 
.PP
Definition at line \fB28\fP of file \fBrte_crypto\&.h\fP\&.
.SS "enum \fBrte_crypto_op_status\fP"
Status of crypto operation 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_CRYPTO_OP_STATUS_SUCCESS \fP
Operation completed successfully 
.TP
\f(BIRTE_CRYPTO_OP_STATUS_NOT_PROCESSED \fP
Operation has not yet been processed by a crypto device 
.TP
\f(BIRTE_CRYPTO_OP_STATUS_AUTH_FAILED \fP
Authentication verification failed 
.TP
\f(BIRTE_CRYPTO_OP_STATUS_INVALID_SESSION \fP
Symmetric operation failed due to invalid session arguments, or if in session-less mode, failed to allocate private operation material\&. 
.TP
\f(BIRTE_CRYPTO_OP_STATUS_INVALID_ARGS \fP
Operation failed due to invalid arguments in request 
.TP
\f(BIRTE_CRYPTO_OP_STATUS_ERROR \fP
Error handling operation 
.PP
Definition at line \fB38\fP of file \fBrte_crypto\&.h\fP\&.
.SS "enum \fBrte_crypto_op_sess_type\fP"
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\&. 
.PP
\fBEnumerator\fP
.in +1c
.TP
\f(BIRTE_CRYPTO_OP_WITH_SESSION \fP
Session based crypto operation 
.TP
\f(BIRTE_CRYPTO_OP_SESSIONLESS \fP
Session-less crypto operation 
.TP
\f(BIRTE_CRYPTO_OP_SECURITY_SESSION \fP
Security session crypto operation 
.PP
Definition at line \fB61\fP of file \fBrte_crypto\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "void __rte_crypto_op_reset (struct \fBrte_crypto_op\fP * op, enum \fBrte_crypto_op_type\fP type)\fR [inline]\fP, \fR [static]\fP"
Reset the fields of a crypto operation to their default values\&.

.PP
\fBParameters\fP
.RS 4
\fIop\fP The crypto operation to be reset\&. 
.br
\fItype\fP The crypto operation type\&. 
.RE
.PP

.PP
Definition at line \fB196\fP of file \fBrte_crypto\&.h\fP\&.
.SS "uint16_t __rte_crypto_op_get_priv_data_size (struct \fBrte_mempool\fP * mempool)\fR [inline]\fP, \fR [static]\fP"
Returns the size of private data allocated with each \fBrte_crypto_op\fP object by the mempool

.PP
\fBParameters\fP
.RS 4
\fImempool\fP \fBrte_crypto_op\fP mempool
.RE
.PP
\fBReturns\fP
.RS 4
private data size 
.RE
.PP

.PP
Definition at line \fB235\fP of file \fBrte_crypto\&.h\fP\&.
.SS "struct \fBrte_mempool\fP * rte_crypto_op_pool_create (const char * name, enum \fBrte_crypto_op_type\fP type, unsigned nb_elts, unsigned cache_size, uint16_t priv_size, int socket_id)"
Creates a crypto operation pool

.PP
\fBParameters\fP
.RS 4
\fIname\fP pool name 
.br
\fItype\fP crypto operation type, use RTE_CRYPTO_OP_TYPE_UNDEFINED for a pool which supports all operation types 
.br
\fInb_elts\fP number of elements in pool 
.br
\fIcache_size\fP Number of elements to cache on lcore, see \fIrte_mempool_create\fP for further details about cache size 
.br
\fIpriv_size\fP Size of private data to allocate with each operation 
.br
\fIsocket_id\fP Socket to allocate memory on
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
On success pointer to mempool
.IP "\(bu" 2
On failure NULL 
.PP
.RE
.PP

.SS "int __rte_crypto_op_raw_bulk_alloc (struct \fBrte_mempool\fP * mempool, enum \fBrte_crypto_op_type\fP type, struct \fBrte_crypto_op\fP ** ops, uint16_t nb_ops)\fR [inline]\fP, \fR [static]\fP"
Bulk allocate raw element from mempool and return as crypto operations

.PP
\fBParameters\fP
.RS 4
\fImempool\fP crypto operation mempool\&. 
.br
\fItype\fP crypto operation type\&. 
.br
\fIops\fP Array to place allocated crypto operations 
.br
\fInb_ops\fP Number of crypto operations to allocate
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
On success returns number of ops allocated 
.PP
.RE
.PP

.PP
Definition at line \fB280\fP of file \fBrte_crypto\&.h\fP\&.
.SS "struct \fBrte_crypto_op\fP * rte_crypto_op_alloc (struct \fBrte_mempool\fP * mempool, enum \fBrte_crypto_op_type\fP type)\fR [inline]\fP, \fR [static]\fP"
Allocate a crypto operation from a mempool with default parameters set

.PP
\fBParameters\fP
.RS 4
\fImempool\fP crypto operation mempool 
.br
\fItype\fP operation type to allocate
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
On success returns a valid \fBrte_crypto_op\fP structure
.IP "\(bu" 2
On failure returns NULL 
.PP
.RE
.PP

.PP
Definition at line \fB308\fP of file \fBrte_crypto\&.h\fP\&.
.SS "unsigned rte_crypto_op_bulk_alloc (struct \fBrte_mempool\fP * mempool, enum \fBrte_crypto_op_type\fP type, struct \fBrte_crypto_op\fP ** ops, uint16_t nb_ops)\fR [inline]\fP, \fR [static]\fP"
Bulk allocate crypto operations from a mempool with default parameters set

.PP
\fBParameters\fP
.RS 4
\fImempool\fP crypto operation mempool 
.br
\fItype\fP operation type to allocate 
.br
\fIops\fP Array to place allocated crypto operations 
.br
\fInb_ops\fP Number of crypto operations to allocate
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
nb_ops if the number of operations requested were allocated\&.
.IP "\(bu" 2
0 if the requested number of ops are not available\&. None are allocated in this case\&. 
.PP
.RE
.PP

.PP
Definition at line \fB338\fP of file \fBrte_crypto\&.h\fP\&.
.SS "void * __rte_crypto_op_get_priv_data (struct \fBrte_crypto_op\fP * op, uint32_t size)\fR [inline]\fP, \fR [static]\fP"
Returns a pointer to the private data of a crypto operation if that operation has enough capacity for requested size\&.

.PP
\fBParameters\fP
.RS 4
\fIop\fP crypto operation\&. 
.br
\fIsize\fP size of space requested in private data\&.
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
if sufficient space available returns pointer to start of private data
.IP "\(bu" 2
if insufficient space returns NULL 
.PP
.RE
.PP

.PP
Definition at line \fB368\fP of file \fBrte_crypto\&.h\fP\&.
.SS "void rte_crypto_op_free (struct \fBrte_crypto_op\fP * op)\fR [inline]\fP, \fR [static]\fP"
free crypto operation structure If operation has been allocate from a \fBrte_mempool\fP, then the operation will be returned to the mempool\&.

.PP
\fBParameters\fP
.RS 4
\fIop\fP Pointer to symmetric crypto operation allocated with \fBrte_crypto_op_alloc()\fP If op is NULL, no operation is performed\&. 
.RE
.PP

.PP
Definition at line \fB398\fP of file \fBrte_crypto\&.h\fP\&.
.SS "struct \fBrte_crypto_op\fP * rte_crypto_sym_op_alloc_from_mbuf_priv_data (struct \fBrte_mbuf\fP * m)\fR [inline]\fP, \fR [static]\fP"
Allocate a symmetric crypto operation in the private data of an mbuf\&.

.PP
\fBParameters\fP
.RS 4
\fIm\fP mbuf which is associated with the crypto operation, the operation will be allocated in the private data of that mbuf\&.
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
On success returns a pointer to the crypto operation\&.
.IP "\(bu" 2
On failure returns NULL\&. 
.PP
.RE
.PP

.PP
Definition at line \fB416\fP of file \fBrte_crypto\&.h\fP\&.
.SS "struct \fBrte_crypto_sym_xform\fP * rte_crypto_op_sym_xforms_alloc (struct \fBrte_crypto_op\fP * op, uint8_t nb_xforms)\fR [inline]\fP, \fR [static]\fP"
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

.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
On success returns pointer to first crypto xform in crypto operations chain
.IP "\(bu" 2
On failure returns NULL 
.PP
.RE
.PP

.PP
Definition at line \fB450\fP of file \fBrte_crypto\&.h\fP\&.
.SS "int rte_crypto_op_attach_sym_session (struct \fBrte_crypto_op\fP * op, void * sess)\fR [inline]\fP, \fR [static]\fP"
Attach a session to a crypto operation

.PP
\fBParameters\fP
.RS 4
\fIop\fP crypto operation, must be of type symmetric 
.br
\fIsess\fP cryptodev session 
.RE
.PP

.PP
Definition at line \fB476\fP of file \fBrte_crypto\&.h\fP\&.
.SS "int rte_crypto_op_attach_asym_session (struct \fBrte_crypto_op\fP * op, struct rte_cryptodev_asym_session * sess)\fR [inline]\fP, \fR [static]\fP"
Attach a asymmetric session to a crypto operation

.PP
\fBParameters\fP
.RS 4
\fIop\fP crypto operation, must be of type asymmetric 
.br
\fIsess\fP cryptodev session 
.RE
.PP

.PP
Definition at line \fB493\fP of file \fBrte_crypto\&.h\fP\&.
.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
